When you download the API key, you will get a .p8 certificate (e.g AuthKey_426ZIF325NY.p8
) but most probably you cannot save this file as a pipeline variable, but you can save it as a string.
Open terminal and go to your Download Folder
then open your file with some Text Editor (preferred) e.g vim AuthKey_426ZIF325NY.p8
or nano AuthKey_426ZIF325NY.p8
, but you can use any editor you are familiar with (e.g VS Code).
You will get something like this:
You need to to save this key as string, but you cannot just copy the content, because there are some \n
symbols you do not see and you will not copy them with normal copy/paste. So you need to add them manually and delete the line brakes:
Before:
-----BEGIN PRIVATE KEY-----
GTAGTAgEAMBMGByqGSM49AgEGTTqGSM49AwEHBHkwdwIBAQQg6YnlZ7oLdukc99KL
TZBVNjYeCpNQtZh3uY2SZw6jh+igCgYIKoZIzj0DAQehRANCAAQ2dMU6ss1I3760
OLjYhPBLn5f1T9ZXVbI4kFcKARM/JfPOKh7rK95LHoEOGdpBQHEaAmZo0x2pnF1+
AhD4UTiE
-----END PRIVATE KEY-----
After:
"-----BEGIN PRIVATE KEY-----\nGTAGTAgEAMBMGByqGSM49AgEGTTqGSM49AwEHBHkwdwIBAQQg6YnlZ7oLdukc99KL\nTZBVNjYeCpNQtZh3uY2SZw6jh+igCgYIKoZIzj0DAQehRANCAAQ2dMU6ss1I3760\nOLjYhPBLn5f1T9ZXVbI4kFcKARM/JfPOKh7rK95LHoEOGdpBQHEaAmZo0x2pnF1+\n
AhD4UTiE\n-----END PRIVATE KEY-----"
Now save this "After" parameter (but use your certificate) as a pipeline variable with name key
.
You Upload Job (Upload to TestFlight) needs access to this certificate and other two variables.
If you want, you can post your fastlane upload lane here and I will write you the additonal part.