Skip to main content

Sending to TestFlight

In the previous tutorial we built the iOS app using GitHub Actions. We can expand on the workflow we created and send our build to TestFlight so that it can be published in the App Store.

Open .github/workflows/app-ios.yml and add the following:


_10
...
_10
- name: Create private key for TestFlight
_10
run: |
_10
mkdir ./private_keys
_10
echo "${{ secrets.APP_STORE_CONNECT_P8 }}" > ./private_keys/AuthKey_${{ secrets.APP_STORE_CONNECT_KEY_ID }}.p8
_10
_10
- name: Send to TestFlight
_10
run: xcrun altool --upload-app -f output/App.ipa -t ios --apiKey ${{ secrets.APP_STORE_CONNECT_KEY_ID }} --apiIssuer ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}

This workflow has these variables that you need to setup in your repository secrets (In your GitHub repo go to Settings > Secrets & Variables > Actions > New repository secret):

These variables are used to upload the app to TestFlight:

Create an App Store Connect API Key

Sign into the Apple Developer Portal

  • Go to Users & Access > Integrations.
  • Click the + button to generate a new API key.
  • Give the key a name and choose Developer as the role.
  • Click Generate to create the key.
  • Save the p8 file.

To create the APP_STORE_CONNECT_P8 secret open the p8 file in a text editor and copy the contents.

Create the APP_STORE_CONNECT_KEY_ID secret by copying the Key ID.

Create the APP_STORE_CONNECT_ISSUER_ID secret from the from the Issuer ID.

Summary

The build process with GitHub Actions should now have all the required variables to build your app and send it to TestFlight.