PPP Mobile App — CI/CD
Workflows
mobile-ci.yml — CI Gate (Lint + Type-check + Tests)
Trigger: Push/PR to main/uat when mobile paths change, or manual dispatch.
| Tier | Job | What it does |
|---|---|---|
| 1 | lint | pnpm lint (ESLint via expo) + pnpm typecheck (tsc --noEmit) |
| 2 | test | pnpm test:ci (Jest with coverage) + Codecov upload |
Tier 2 only runs if Tier 1 passes (needs: [lint]).
Coverage: Thresholds configured in package.json (coverageThreshold). Coverage summary posted to GitHub Actions step summary. Uploaded to Codecov with mobile-ppp flag.
mobile-build-dev.yml — Legacy EAS Cloud Build (deprecated)
Deprecated: Use
mobile-build-native.ymlinstead. This workflow used EAS cloud builds which are slower and less reliable than native GitHub Actions builds.
mobile-build-native.yml — Native Build & Deploy (primary, owns store submission)
This is the workflow that actually delivers a build to TestFlight / Play Store. It builds natively (no EAS cloud) and, when submit: true, immediately submits the same run's build via Fastlane's upload_testflight (pilot) lane (iOS → TestFlight) and r0adkll/upload-google-play (Android → Play Store). The iOS submit step used to run xcrun altool; that was replaced with the Fastlane lane after Xcode 26 broke altool's legacy --upload-package flag syntax (#9945) — see the "Submit IPA to TestFlight via fastlane" step's own header comment for the full story. A separate mobile-distribute.yml workflow previously claimed to own this (its name literally said "Distribute"), but never had a single successful run in its history and was removed (#11007) — see the CD section immediately below for how a build actually gets here.
Trigger: workflow_dispatch (manual, submit input defaults true) or workflow_call from mobile-cd.yml, which invokes it automatically once daily (schedule) when mobile/ppp/** has changed since the last successful deploy, or unconditionally (any time, subject to the shared mobile-cd-* concurrency group queueing behind an in-progress run) on mobile-cd.yml's own workflow_dispatch (#11149 — see the CD section immediately below).
Inputs:
| Input | Type | Default | Description |
|---|---|---|---|
platform | choice | all | all / ios / android |
profile | choice | development | development / preview / production |
submit | boolean | true | Submit to stores after build |
Jobs:
build-ios— Builds on a GitHub-hostedmacos-15runner using Xcode (xcodebuild archive + exportArchive) — no self-hosted Mac mini requiredbuild-android— Builds onubuntu-latestusing Gradle (bundleRelease+assembleRelease)close-success/report-failure— Auto-manages GitHub issues
Artifacts:
android-aab-development— AAB for Google Play submissionandroid-apk-development— APK for emulator/device testing (#1817)ios-ipa-development— IPA for TestFlightios-dsyms-development— dSYMs for manual crash symbolication, 30-day retention (#11000)android-symbols-development— unstripped native.solibraries + R8 mapping when present, 30-day retention (#11000)
Symbol retention (#11000): the ios-dsyms-* artifact makes any .ips crash report symbolicatable with only repo access — no SENTRY_AUTH_TOKEN, which nobody has outside CI. CI proves the artifact matches what shipped: it reads the exported IPA's LC_UUIDs with dwarfdump -u and fails the job before the TestFlight submit if any is missing from the archived dSYMs. This is additive to the #10831 gate below, which is unchanged. See the Symbolication Runbook.
dSYM / symbolication release gate (#10831): for release/TestFlight builds (inputs.submit == true), the build-ios job hard-gates on three sequential steps — dSYM upload to Sentry, local dSYM validity check, and a post-upload smoke-check that confirms the build's dSYM UUIDs are actually resolvable via the live Sentry API (GET /projects/{org}/{project}/files/dsyms/). None of the three is continue-on-error — a failure fails the job and the build does not ship. See the Symbolication Runbook for what to do when this gate fails.
mobile-cd.yml — Automated Trigger for mobile-build-native.yml
This is how a build reaches a device without anyone manually dispatching anything. Once daily (schedule, not push — see below), it resolves the branch → EAS-style profile mapping (uat → preview; anything else → production, though production pushes are currently disabled pending go-live, #4537) and calls mobile-build-native.yml with submit: true — the same build-and-submit run described above, just triggered by the schedule instead of a manual dispatch.
Trigger (#11149): a daily schedule — cron: '0 20 * * *' (20:00 UTC = 21:00 BST/UTC+1, Matt's requested 9pm cadence; fixed offset, not DST-adjusted) — or manual workflow_dispatch (environment + platform inputs), which is the unconditional urgent-fix override. Previously this fired on every push to uat that touched mobile/ppp/**, which queued a fresh TestFlight/Play Store internal build several times a day whenever multiple mobile PRs merged — disrupting Matt's in-flight manual testing (an update mid-test looks identical to a glitch). Mirrors cd.yml's push-trigger-removed + daily-schedule pattern (#9994): a detect-changes job diffs against the last mobile-cd run that actually published an APK (not last push, and not merely last successful run — a run whose build job was skipped still concludes success, so the baseline only advances onto one that shipped android-apk-preview, via detect-changes-baseline.mjs's requireArtifact option, #11493), so a scheduled run with nothing new in mobile/ppp/** skips the native build job entirely — the schedule doesn't reintroduce push-per-merge churn under a different trigger. workflow_dispatch bypasses detect-changes and always runs.
mobile-e2e.yml — Maestro E2E Tests
Trigger: Daily 6 AM UTC schedule (0 6 * * *) + manual workflow_dispatch.
Inputs (manual dispatch only):
| Input | Type | Default | Description |
|---|---|---|---|
platform | choice | android | android / ios / both |
flow | string | (blank) | Specific flow YAML to run (blank = all flows) |
Jobs:
| Job | Runner | What it does |
|---|---|---|
android-e2e | ubuntu-latest | Boot Android emulator, download latest dev APK from native build artifacts, run Maestro flows |
ios-e2e | macos-latest | Boot iOS simulator, download latest dev .app from native build artifacts, run Maestro flows |
report | ubuntu-latest | Auto-create GitHub issue on failure; auto-close on recovery |
Schedule behaviour: The daily cron runs Android only. iOS is only triggered via manual dispatch with platform: ios or platform: both (macOS runners are expensive).
Maestro flows (in mobile/ppp/e2e/):
login.yaml-- app launch, Cognito sign-in, dashboard visiblelogbook-entry.yaml-- navigate to Surgical Logbook, add procedure, verify in listtimesheet-entry.yaml-- navigate to Timesheet, create entry, verify savedwellness-entry.yaml-- navigate to Wellness, complete questionnaire, verify score
Auto-issue management: Uses a dedicated mobile-e2e-failure label. On failure, creates or comments on an open issue. On recovery, adds a "Resolved" comment and closes the issue (mirrors e2e.yml pattern).
Build prerequisite: The workflow downloads the latest development APK from mobile-build-native.yml artifacts. If no build exists, trigger a build first via the mobile-build-native.yml workflow.
Secrets required: E2E_TEST_EMAIL, E2E_TEST_PASSWORD (see secrets table below).
Issues: #651
mobile-store-listing.yml -- Store Listing Sync
Trigger: Manual workflow_dispatch + push to main/uat when metadata files change.
Inputs (manual dispatch only):
| Input | Type | Default | Description |
|---|---|---|---|
platform | choice | all | all / ios / android |
dry_run | boolean | true | Preview changes without applying |
whats_new_only | boolean | false | Only sync release notes (iOS only) |
Jobs:
| Job | Runner | What it does |
|---|---|---|
validate | ubuntu-latest | Validates metadata files (character limits, required fields) |
sync-ios | macos-latest | Syncs iOS metadata to App Store Connect via Fastlane deliver or ASC API |
sync-android | ubuntu-latest | Syncs Android metadata to Google Play via Publishing API (Node.js script) |
Push behaviour: Metadata file changes on main/uat trigger a dry run automatically. Manual dispatch with dry_run = false is required to apply changes.
Android sync uses the Google Play Publishing API directly (edits.listings, edits.tracks) via scripts/google-play-metadata-sync.mjs. This provides atomic metadata updates (create edit, modify, commit/rollback) without requiring Fastlane/Ruby.
Country targeting: Configured in store-config/distribution.json and applied via the --set-country-targeting flag. Currently targets GB and AU with restOfWorld: false.
Metadata paths: mobile/ppp/fastlane/metadata/android/{locale}/ for Android, mobile/ppp/fastlane/metadata/ios/{locale}/ for iOS.
Secrets required: GOOGLE_PLAY_JSON_KEY, APP_STORE_CONNECT_API_KEY_ID, APP_STORE_CONNECT_API_KEY_ISSUER_ID, APP_STORE_CONNECT_API_KEY_CONTENT.
Standardised Path Filters
All mobile CI workflows use a consistent set of path filters (documented per #1233):
paths:
# Include
- 'mobile/ppp/**' # Mobile app source
- 'packages-shared/ppp/**' # Shared schemas used by mobile
- 'packages/core-constants/**' # Shared constants
# Exclude (non-code changes)
- '!mobile/ppp/**/*.md' # Markdown files
- '!mobile/ppp/docs/**' # Documentation directory
- '!mobile/ppp/memory-bank/**' # Memory bank (dev tooling)
- '!mobile/ppp/.cursorrules' # Editor configRationale:
- Changes to
packages-shared/ppp/**orpackages/core-constants/**may affect mobile app behavior, so they trigger mobile CI - Documentation-only changes do not trigger CI (saves runner minutes)
- The
mobile-build-dev.ymlandmobile-e2e.ymlworkflows use manual/scheduled triggers only, so path filters are not applicable
Required GitHub Actions Secrets
All secrets below are Pulumi-managed via
api/infra-github/(theppp-githubstack). The source of truth is Dopplerppp/dev(renamed fromppp/shareper #5171 — this doc previously still saidppp/share, corrected in #9930). Runcd api/infra-github && pnpm upto sync any Doppler change to GitHub Actions automatically. Do not set these manually in GitHub repo settings — Pulumi will overwrite them on the nextpulumi up. See #2865.
WEB_URL/TRPC_URLper environment are not GitHub secrets —mobile-build-native.ymlhardcodes both UAT and production URLs as literals keyed offAPP_VARIANT(see theWEB_URL/TRPC_URLenv:lines in that workflow).UAT_WEB_URL,UAT_TRPC_URL,PROD_WEB_URL,PROD_TRPC_URLand amobile-build-prod.ymlconsumer were previously listed below as if live —mobile-build-prod.ymlnever existed andmobile-build-dev.ymlis the now-deprecated legacy EAS workflow above;mobile-build-native.ymlis the sole build workflow today and none of the four URL secrets are referenced by any workflow (#9930 audit — removed from this table).
| Secret | Description | Used by | Doppler key |
|---|---|---|---|
APPLE_ASC_KEY_P8 | Base64-encoded App Store Connect API key .p8 file contents | mobile-build-native.yml | APPLE_ASC_KEY_P8 |
APPLE_ASC_KEY_ID | App Store Connect API Key ID (e.g. 3YLJ5AQ8TZ) | mobile-build-native.yml | APPLE_ASC_KEY_ID |
APPLE_ASC_ISSUER_ID | App Store Connect API Issuer ID (UUID) | mobile-build-native.yml | APPLE_ASC_ISSUER_ID |
APPLE_TEAM_ID | Apple Developer Team ID (e.g. 9T8B78M6P3) | mobile-build-native.yml | APPLE_TEAM_ID |
IOS_DIST_CERT_P12_BASE64 | Combined distribution certificate + private key (P12), base64-encoded | mobile-build-native.yml | IOS_DIST_CERT_P12_BASE64 |
IOS_DIST_CERT_PASSWORD | Export password for the P12 above | mobile-build-native.yml | IOS_DIST_CERT_PASSWORD |
IOS_PROVISIONING_PROFILE_BASE64 | App Store provisioning profile for com.professionalperformanceportfolio.ppp, base64-encoded | mobile-build-native.yml | IOS_PROVISIONING_PROFILE_BASE64 |
APPLE_PROD_ASC_APP_ID | Numeric App Store Connect app ID for bundle com.professionalperformanceportfolio.ppp (find in App Store Connect → App Information → Apple ID) | mobile-build-native.yml | APPLE_PROD_ASC_APP_ID |
APP_STORE_CONNECT_API_KEY_ID | ASC API Key ID for Fastlane distribution — aliased to APPLE_ASC_KEY_ID (same credential, Fastlane-specific secret name; no separate Doppler entry, #9930) | mobile-store-listing.yml | APPLE_ASC_KEY_ID |
APP_STORE_CONNECT_API_KEY_ISSUER_ID | ASC API Issuer ID for Fastlane distribution — aliased to APPLE_ASC_ISSUER_ID (#9930) | mobile-store-listing.yml | APPLE_ASC_ISSUER_ID |
APP_STORE_CONNECT_API_KEY_CONTENT | Base64-encoded .p8 key content for Fastlane distribution — aliased to APPLE_ASC_KEY_P8 (#9930) | mobile-store-listing.yml | APPLE_ASC_KEY_P8 |
GOOGLE_PLAY_SERVICE_ACCOUNT_KEY | Base64-encoded Google Play service account JSON key (must have Google Play Developer API enabled and Google Play Android Developer role on package com.professionalperformanceportfolio.ppp) | mobile-build-native.yml, mobile-store-listing.yml (base64-decoded at point of use — see below) | GOOGLE_PLAY_SERVICE_ACCOUNT_KEY |
CODECOV_TOKEN | Codecov upload token | mobile-ci.yml | CODECOV_TOKEN |
E2E_TEST_EMAIL | Test account email for Maestro E2E flows | mobile-e2e.yml | E2E_TEST_EMAIL |
E2E_TEST_PASSWORD | Test account password for Maestro E2E flows | mobile-e2e.yml, bdd-uat.yml, mobile-web-bdd.yml, cd.yml | E2E_TEST_PASSWORD |
TEST_ACCOUNT_PASSWORD | Shared QA seed-account password (#4385), despite the historical "UAT" framing this is the same ppp/dev config as everything else in this table (#9930) | cd.yml ("Seed UAT test accounts" step) | TEST_ACCOUNT_PASSWORD |
GOOGLE_PLAY_JSON_KEYis not a GitHub secret, and the two consumers below decodeGOOGLE_PLAY_SERVICE_ACCOUNT_KEY(base64, to match the EAS/Gradle build secret) into the raw JSON it holds by two different mechanisms — they are not interchangeable:
mobile-build-native.yml's "Write and validate store credentials" step base64-decodes the secret straight to a file (credentials/google-play-service-account.json), which is passed directly tor0adkll/upload-google-play'sserviceAccountJson:file-path input. NoGOOGLE_PLAY_JSON_KEYenv var is created in this path.mobile-store-listing.yml's "Decode Google Play service account key" step base64-decodes the secret into a maskedGOOGLE_PLAY_JSON_KEYenv var, which is whatgoogle-play-metadata-sync.mjsand Fastlane'sjson_key_dataactually read.Before #9930 both
mobile-store-listing.ymland (the now-removed, #11007)mobile-distribute.ymlfed the base64 value straight through under theGOOGLE_PLAY_JSON_KEYname, which failed on every run (GOOGLE_PLAY_JSON_KEY is not valid JSON) —mobile-store-listing.yml's Android job had been red since at least 2026-03-25.
How Secrets Flow into Builds
Doppler (ppp/dev)
│
▼ doppler run (api/infra-github/scripts/run.sh)
Pulumi (api/infra-github)
│ @pulumi/github ActionsSecret (idempotent upsert)
▼
GitHub Actions secrets
│
▼ workflow env: block
Gradle / Xcode / Fastlane / Jest
│
▼
app.config.js → expo.extra → Constants.expoConfig.extra- Doppler
ppp/devis the single source of truth for all mobile CI secrets (renamed fromppp/shareper #5171) cd api/infra-github && pnpm upsyncs Doppler values → GitHub Actions secrets via Pulumi- GitHub Actions secrets are mapped to environment variables in the workflow
env:block - Gradle/Xcode picks up environment variables during native build (via
expo prebuild+app.config.js) mobile-build-native.ymlsetsWEB_URL/TRPC_URLas hardcoded per-APP_VARIANTliterals (not Doppler secrets — see above), andapp.config.jsreadsprocess.env.WEB_URL/process.env.TRPC_URLintoexpo.extra- The app accesses these at runtime via
Constants.expoConfig.extra
Adding a New Secret
- Add the secret value to Doppler:
doppler secrets set MY_SECRET --project ppp --config dev - Add a
repoSecret('MY_SECRET', requireEnvSecret('MY_SECRET'))call inapi/infra-github/src/index.ts - Run
cd api/infra-github && pnpm up— Pulumi will create the secret in GitHub Actions - Reference
${{ secrets.MY_SECRET }}in the relevant workflow
Setup Instructions (first-time bootstrap)
Create a fine-grained GitHub PAT with
secrets: writescope on this repository. Store it in Doppler asPULUMI_GITHUB_TOKENunderppp/dev.Install dependencies:
cd api/infra-github && pnpm installLog in to Pulumi state backend (shared with
infra-azure):bashbash api/infra-github/scripts/run.sh -- login azblob://pulumi-statePreview changes:
bashcd api/infra-github && pnpm previewApply secrets (creates/updates all secrets in GitHub Actions):
bashcd api/infra-github && pnpm up
Verify secret scoping
- All secrets are repository-level (not environment-level) so they are available to all workflows
Signing Credentials
Apple and Android signing credentials are stored as GitHub Actions secrets and managed via Doppler/Pulumi (see above).
iOS (used by mobile-build-native.yml):
IOS_DIST_CERT_P12_BASE64— Combined distribution certificate + private key (P12)IOS_DIST_CERT_PASSWORD— Password for the P12 fileIOS_PROVISIONING_PROFILE_BASE64— Development/preview provisioning profileAPPLE_ASC_KEY_P8— App Store Connect API key for TestFlight submission
Android (used by mobile-build-native.yml):
ANDROID_KEYSTORE_BASE64— Release keystore (base64-encoded)ANDROID_KEYSTORE_PASSWORD,ANDROID_KEY_ALIAS,ANDROID_KEY_PASSWORD— Keystore credentialsGOOGLE_PLAY_SERVICE_ACCOUNT_KEY— Google Play API access for store submission
The credentials/ directory is gitignored. See #2880 for native build setup and #1672 for App Store Connect API Key configuration.
Security Notes
- Secrets are never printed in workflow logs (GitHub automatically masks them)
app.config.jsmust never contain hardcoded secret valuesWEB_URLandTRPC_URLare injected at build time only, not committed to source
App Store Connect Details (Development)
| Field | Value |
|---|---|
| Name | PPP (Development) |
| Bundle ID | com.professionalperformanceportfolio.ppp.development |
| SKU | EX1736765541823 |
| Apple ID / ASC App ID | 6740482813 |
Monorepo Package Manager Note
The mobile directory uses pnpm (>= 9), aligned with the rest of the monorepo. Mobile CI jobs use pnpm/action-setup@v4 and reference mobile/ppp/pnpm-lock.yaml.
Troubleshooting: Google Play API Credentials
If Android submission fails with a credentials error, check the following:
1. Service account setup in Google Cloud Console
- Go to Google Cloud Console > IAM & Admin > Service Accounts
- The service account must be
ppp-play-publisher@ppp-shared-489312.iam.gserviceaccount.com(or as listed instore-config/distribution.json) - The Google Play Android Developer API must be enabled on the project
2. Service account permissions in Google Play Console
- Go to Google Play Console > Users and permissions
- The service account email must be invited with the Release manager role (or custom role with
Release to productionpermission) - The service account must be granted access to the app
com.professionalperformanceportfolio.ppp
3. Key format in Doppler/GitHub secrets
GOOGLE_PLAY_SERVICE_ACCOUNT_KEYis the only Doppler-managed secret: it must be the base64-encoded contents of the service account JSON key file. Generate via:base64 -i service-account-key.json | tr -d '\n'- It must contain
"type": "service_account","project_id","private_key", and"client_email"fields once decoded GOOGLE_PLAY_JSON_KEY(the raw-JSON form Fastlane andgoogle-play-metadata-sync.mjsneed) is not a separate secret —mobile-store-listing.ymlbase64-decodesGOOGLE_PLAY_SERVICE_ACCOUNT_KEYinto it at point of use;mobile-build-native.ymldecodes the same secret straight to a credentials file instead, with noGOOGLE_PLAY_JSON_KEYenv var involved (see "Required GitHub Actions Secrets" above)
4. Key expiration
- Google Cloud service account keys do not expire by default, but they can be deleted or rotated
- If the key was rotated, update
GOOGLE_PLAY_SERVICE_ACCOUNT_KEYin Dopplerppp/devand re-runcd api/infra-github && pnpm upto sync to GitHub Actions
5. Credential validation
The mobile-build-native.yml workflow validates the service account JSON structure before attempting submission. Check the "Write and validate store credentials" step output for specific error messages.
See #3112 for the original credential failure investigation.