Expo's own build service, EAS, is the easy path. We skipped it, mostly to avoid the subscription, and built and shipped the app ourselves: Fastlane for the store work, GitHub Actions to run it, and Expo only for generating the native projects. It took some bruises to get right. Here's the shape that held up, and the traps worth knowing before you start.
The pipeline
- Beta buildany branch, to Firebase testers (iOS ad-hoc, Android APK)
- Testers sign offa tag records the exact commit they tested
- Store buildTestFlight or Play internal, built from that commit
- Test that buildon real devices, from the store's own channel
- Submit the same buildno rebuild; Play promotes the same versionCode
Each of these rules exists because the alternative went wrong at some point:
- Workflows only run when someone starts them. No tag triggers, so a stray or mistyped tag can never ship anything. Runs still push a tag afterwards, as a record.
- The version is a workflow input, written into
app.jsonin the CI copy before prebuild, and committed only when a build actually ships. Committing version bumps from build workflows fell apart once we had more than one long-lived branch: a bump made on the beta branch never reachedmain. - The build number is the CI run number, so re-runs never collide.
- iOS releases in two stages. Build to TestFlight, check it, then submit that already-uploaded build with
skip_binary_upload. Submitting straight to review means the store build is never tested on a device. - Google Play does the same. Upload to the internal track, then promote that exact
versionCodewithtrack_promote_to.
Betas come first
Every release starts as a beta. The beta workflow is the one people run most, so it's built to be quick to start and hard to misuse:
- Pick a branch, any branch. It defaults to a test environment's branch, so a fix can reach testers without merging anything first.
- The version is optional. Set it and it's stamped into the CI copy for this build only. Leave it empty and the branch builds exactly as it is.
- Choose iOS, Android or both, so a fix for one platform doesn't push an unrelated build at the other platform's testers. Each platform has its own tester group.
- Write release notes for testers right in the workflow form, or get a default that names the platform, version and build number.
- A newer beta of the same branch cancels the older run, since nobody wants to test the stale one.
- iOS betas are ad-hoc builds, so every tester's device has to be registered, and the profile regenerated when testers change.
When the iOS beta succeeds, it pushes a tag recording the version, build and commit. The TestFlight and Play internal workflows then build from that tagged commit, so the store build is made from exactly the code testers already signed off, not whatever the branch has moved on to since.
The beta build also reads from our shared Nx cache, so libraries main already built don't get rebuilt on an expensive macOS runner.
macOS runner minutes cost roughly ten times Linux ones, and a cold release build of a New Architecture app took about 16 minutes. That's one more reason builds only run when someone asks for them.
Five breakages before the first green iOS build
In the order CI hit them. Expect the same set on a new pipeline.
pnpm installreturned 401 on a private package, because the install step had no registry auth.matchcouldn't use the keyless cloud credential. That credential file has no project ID, whichmatch's storage backend requires. We gavematcha real service-account key and kept keyless auth for everything else.- The JS bundle couldn't find workspace libraries, because Fastlane's build calls
xcodebuilddirectly and skips the monorepo's own dependency builds. Build those libraries first. codesignhung for about 22 minutes waiting on a keychain prompt nobody could answer. Runsetup_cibeforematch; it creates a temporary keychain.- The Crashlytics symbol upload looked in the wrong folder for
Pods. Point it at the right path explicitly.
Also: Expo's prebuild leaves the iOS project on automatic signing with no team, so CI has to switch it to manual signing with the match profile after every prebuild.
Google Play traps
- The
versionCodehas to reachbuild.gradlethrough prebuild, for example from a build number inapp.config.js. Setting it only on the Fastlane step shipsversionCode 1, and Play rejects every upload after the first. - Play won't accept uploads from the API until you've uploaded one bundle by hand. That first manual upload also fills in the upload key on the App integrity page.
- A promotion can land as a draft, and nothing reaches users until someone sets the release notes and rollout in the Console.
- Play's API can be keyless: invite the CI service account in Play Console as a release manager.
- The default Linux runner ran out of disk on a release build; a larger runner fixed it. Set a timeout so a hung job can't run for hours.
Making Android builds faster
Most of the Android job's time wasn't compiling. It was Gradle getting started: downloading the wrapper, resolving dependencies and configuring 60-odd modules. Caching the Gradle home folder, keyed on the lockfile and app.json, cut one job from 12 minutes 14 seconds to 7 minutes 23.
One trap: a gradlew clean step took 2 minutes 37 seconds and looked like waste. Removing it just moved that time into the next step, because it had been warming the Gradle daemon. Before blaming a step for its time, check whether the step after it got faster.
Signing and secrets
matchstores certificates in a private cloud bucket, and the CI account needs read access to the bucket itself as well as its objects.matchcan't create App IDs. Registering the app and creating its App Store Connect record stay one-time manual steps.- The App Store Connect API key can't be downloaded twice, so store it the moment you create it.
- For running lanes locally, commit only references to secrets in a password manager, and run Fastlane through a small wrapper that fills them in. Nothing goes in shell profiles.
- Changing an App ID capability, like turning on push notifications, invalidates the existing profiles, so keep a workflow that regenerates signing.
How to debug it without burning CI minutes
Reproduce the CI build locally in a separate git worktree, with a clean install, instead of waiting on 20-minute runs. And remember that composite actions and the Fastfile are read from the branch being built: if betas build a branch other than main, CI fixes have to land there too.