Skip to content

Commit cfb27b2

Browse files
committed
fix(ci): give the TestFlight build Apple auth so a new target can get a profile
The share extension is a second build target with its own bundle identifier, and a new target needs its own provisioning profile. The workflow wrote the App Store Connect key only for the submit step, so the build step had no Apple authentication: EAS fell back to an interactive login and failed with "Failed to set up credentials" before it could create the profile. The key and issuer ids are read from eas.json rather than repeated here, so the build and submit steps cannot disagree about which key they mean.
1 parent 767d37a commit cfb27b2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/ios-testflight.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,23 @@ jobs:
5454
printf '%s\n' "$ASC_API_KEY_P8" > asc-api-key.p8
5555
chmod 600 asc-api-key.p8
5656
openssl pkey -in asc-api-key.p8 -noout -check
57+
# Read the key/issuer ids from eas.json rather than repeating them, so the
58+
# build and submit steps can never disagree about which key they mean.
59+
node -e '
60+
const ios = require("./eas.json").submit.testflight.ios;
61+
const out = require("fs");
62+
out.appendFileSync(process.env.GITHUB_ENV,
63+
`EXPO_ASC_KEY_ID=${ios.ascApiKeyId}\nEXPO_ASC_ISSUER_ID=${ios.ascApiKeyIssuerId}\n`);
64+
'
5765
5866
- name: Build and submit to TestFlight
5967
if: inputs.build_id == ''
68+
# The ASC key is exported for the *build*, not just the submit step: a new
69+
# target (the share extension) needs its own provisioning profile, and
70+
# without Apple auth EAS falls back to an interactive login and fails
71+
# non-interactive builds with "Failed to set up credentials".
72+
env:
73+
EXPO_ASC_API_KEY_PATH: ${{ github.workspace }}/app/asc-api-key.p8
6074
run: eas build --platform ios --profile testflight --auto-submit --non-interactive
6175

6276
- name: Submit existing build to TestFlight

0 commit comments

Comments
 (0)