microsoft / app-store-vsts-extension

Visual Studio Team Services (VSTS) extension for performing continuous delivery to the App Store store from your automated CI builds
Other
95 stars 53 forks source link

Unable to publish build to external group of testers on TestFlight #252

Closed ederbond closed 3 years ago

ederbond commented 3 years ago

I'm trying to upload an *.ipa file generated by AzureDevOps to an External Group of user that I've created on Apple's TestFlight and then, it first asked me to set a release notes file which I just did as you can see in the image bellow, but now the build fails with the following error message: ##[warning]You specified releaseNotes - so you need to provide fastlane session, app specific password only won't work.

image

BTW despite of showing the my release as error on Azure DevOps Release Pipeline is actually uploading my ipa file to apple store but to the wrong group of testers. The ipa is being uploaded to the "Internal Group" of testers called "App Store Connect Users" instead of the "External Groups" that I've created called "DEV DB" image

Does anybody knows how could I make this Azure DevOps task to upload my ipa file to my External Group of testers on TestFlight ?

FYI my service connection is configured using a Token Based Authentication as you can see bellow: image

Originally posted by @ederbond in https://github.com/microsoft/app-store-vsts-extension/issues/215#issuecomment-857932927

max-zaytsev commented 3 years ago

@ederbond Could you please share pipeline logs in debug mode?

ederbond commented 3 years ago

Do you think it could be the role I've choosed when I've created my api key on apple developer portal? image

max-zaytsev commented 3 years ago

@ederbond yes. Some fastlane commands require app manager permissions

ederbond commented 3 years ago

I've just generated a new API Key with apple but I'm still getting error image

max-zaytsev commented 3 years ago

@ederbond,

looks like wrong encoding of the api key:

2021-06-10T15:28:54.0971950Z /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.183.2/spaceship/lib/spaceship/connect_api/token.rb:62:in initialize': [!] invalid curve name (OpenSSL::PKey::ECError)

You need to encode the content of .p8 file to base64 to use it in the task. You can try this tool or the following powershell snippet:

$api_key_content = '-----BEGIN PRIVATE KEY-----
YourPrivateKeyMIGAMBMGByqKxW3ZWKlSZEQ9EeLajuO6VE7MO26rwDoHUcD
Be6zkyp2SAUU99QS/3TPiKlOQ6agCgYIKoZIzj0DAQehRANCAAQTymeZ9NqX8rO
+ax7gdRMBMGByqKxW3ZWKlSZEMBMGByqKxW3ZWKlSZEMBMGByqKxW3ZW
-----END PRIVATE KEY-----'

[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($api_key_content))
ederbond commented 3 years ago

Thank you so much for the help @max-zaytsev , after generating the App Store Connect API Key with the role "App Manager" and encoding it's content to base64 as you mentioned it worked just fine. Now my release builds are correctly being uploaded to my external group of testers on TestFlight. Thank U!