fix(mobile): give the widget and notification-service targets a team id - #109
Merged
Conversation
@bacons/apple-targets reads ios.appleTeamId to stamp DEVELOPMENT_TEAM onto the targets it generates. The field was never set, so prebuild took the "no team anywhere" branch: it strips DEVELOPMENT_TEAM from every target and writes the literal `DevelopmentTeam = undefined;` into TargetAttributes. It also warns "iOS builds may fail until this is corrected" on every CI prebuild. Sourced from EXPO_APPLE_TEAM_ID so the id stays out of the repo. Also corrects release-mobile.yml's CREDENTIALS block, which predicted the wrong failure. EAS sets iOS credentials up per target, and in non-interactive mode SetUpDistributionCertificate can only reuse a certificate already assigned to that target: no branch adopts an unassigned account certificate and none creates one. An ASC API key does not help, since the rc1 run was already using one when it failed at the certificate lookup, and it cannot link App Group identifiers at all. The build step now names the target and the command to run instead of leaving eas-cli's bare "run this command again in interactive mode". Refs #104 Claude-Session: https://claude.ai/code/session_01QsVEsfkynXpJWK4t33exG9
…ne is absent pipefail plus the job shell's -e meant a no-match grep would kill the step before it printed the annotation it exists to print. Refs #104 Claude-Session: https://claude.ai/code/session_01QsVEsfkynXpJWK4t33exG9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This sets
ios.appleTeamIdfrom a newEXPO_APPLE_TEAM_IDsecret, rewrites release-mobile.yml's CREDENTIALS block, and makes the iOS build step name the target that's missing credentials. It doesn't unblock rc1 on its own; the credentials themselves need an interactive run only you can do, listed at the bottom.Why rc1 failed
EAS sets iOS signing up per target. rc1 enumerated three:
app.pegadareused its stored certificate and profile fine.app.pegada.widgetshas never had credentials stored, andSetUpDistributionCertificate.runNonInteractiveAsync(eas-cli 21.3.0) is four lines:currentCertificatecomes fromgetDistributionCertificateForAppAsync, which queries by that target's own bundle id. No branch adopts the account's existing certificate (6ZL5FHSFHB), and none creates one. That throw prints as "Credentials are not set up. Run this command again in interactive mode."Option 2 from the issue wouldn't have fixed it. rc1 was already authenticated with an ASC API key (
Using App Store Connect API Key from EAS credentials service) and still died at the certificate lookup, which runs before any profile work. The key also can't finish the job on its own:syncCapabilityIdentifiersForEntitlementsAsyncbails out on token auth withSkipping capability identifier syncing because the current Apple authentication session is not using Cookies, andapp.pegada.widgetsneedsgroup.app.pegadalinked to its App ID. Apple ID auth is what links App Groups.So option 1, and I rewrote the CREDENTIALS comment block that predicted option 2.
Missing team id
@bacons/apple-targetshas warned about this on every prebuild we've run, CI included:applyDevelopmentTeamIdToTargetsfalls back to anyDEVELOPMENT_TEAMalready present on a target, and a prebuild-generated project has none, so it takes the else branch:removeBuildSetting("DEVELOPMENT_TEAM")across every target, then writesDevelopmentTeam: undefinedintoTargetAttributes, which serializes into the pbxproj as that literal string.app.config.tsclaimed "Team ID comes from EAS credentials at build time". Prebuild runs long before the signing step. Bothexpo-target.config.jsfiles repeated the claim, so I fixed it in all three.I pulled the value from
EXPO_APPLE_TEAM_IDinstead of hardcoding it, since the repo is public. Setting it on the build step is enough, because env vars reacheas build --local's isolated working copy.Error message
eas-cli's error names neither the target nor a command, and it lands ~40s into a job whose release notes already published. #104's first read blamed the ASC key. The build step translates it now.
Proof
expo prebuild -p iosonmainvs this branch.DevelopmentTeam = undefinedbecomes a real id on both extension targets, andDEVELOPMENT_TEAMlands on all six build configurations (Pegada, PegadaWidgets, PegadaNotificationService, Debug and Release each).ABCDE12345is a placeholder; the real id lives in the secret.Full diff: prebuild-development-team.diff
Warning's gone:
The new failure branch, against a stubbed
easreplaying rc1's output. I checked the other two paths too: exit 0 passes straight through, and a non-credentials failure exits 1 with no annotation and an empty step summary.What I couldn't verify
No iOS release build ran. Signing needs the certificate and the Expo account, so the credentials half of #104 stays unproven until someone with App Store Connect access runs it. Verified locally: the prebuild output above, the three shell paths,
oxfmt,oxlint,tsc --noEmit.Left for you
gh secret set EXPO_APPLE_TEAM_ID -R GSTJ/pegada, the 10-character id under Membership in App Store Connect. Until it exists the build just warns.apps/mobile:eas credentials -p ios, production profile, once forPegadaWidgetsand once forPegadaNotificationService. Sign in with the Apple ID rather than the API key or the App Group won't link. Reuse certificate 6ZL5FHSFHB and let EAS mint each profile.v1.5.0-rc1.A fourth target later costs step 2 again.
eas credentials:configure-buildhardcodesnonInteractive: false, so there's nothing to automate against.Refs #104
Claude-Session: https://claude.ai/code/session_01QsVEsfkynXpJWK4t33exG9