Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

ci(mobile): build and upload apps on Blacksmith

Amruth Pillai130fe48fae8a
diff --git a/.github/workflows/mobile-forme-native.yml b/.github/workflows/mobile-forme-native.yml
index 629af1204..6dd42e188 100644
--- a/.github/workflows/mobile-forme-native.yml
+++ b/.github/workflows/mobile-forme-native.yml
@@ -13,7 +13,7 @@ permissions:
jobs:
prebuilt:
- runs-on: macos-15
+ runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-6vcpu-macos-26' || 'macos-26' }}
timeout-minutes: 60
outputs:
tag: ${{ steps.artifact.outputs.tag }}
@@ -94,4 +94,4 @@ jobs:
TAG: ${{ needs.prebuilt.outputs.tag }}
ARTIFACT_DIR: ${{ runner.temp }}/forme-native
run: |
- gh release create "$TAG" "$ARTIFACT_DIR/$TAG.tar.gz" "$ARTIFACT_DIR/prebuilt.json" --target "$GITHUB_SHA" --title "$TAG" --notes "Native Forme binaries. Review and commit prebuilt.json before EAS Build." --prerelease
+ gh release create "$TAG" "$ARTIFACT_DIR/$TAG.tar.gz" "$ARTIFACT_DIR/prebuilt.json" --target "$GITHUB_SHA" --title "$TAG" --notes "Native Forme binaries. Review and commit prebuilt.json before building mobile apps." --prerelease
diff --git a/.github/workflows/mobile-release.yml b/.github/workflows/mobile-release.yml
new file mode 100644
index 000000000..492e916e3
--- /dev/null
+++ b/.github/workflows/mobile-release.yml
@@ -0,0 +1,189 @@
+name: Mobile Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ platform:
+ description: Platforms to build
+ type: choice
+ options: [all, android, ios]
+ default: all
+ upload:
+ description: Upload to TestFlight / Play internal draft (never submit review or publish)
+ type: boolean
+ default: false
+
+permissions:
+ contents: read
+
+concurrency:
+ group: mobile-release
+ cancel-in-progress: false
+
+env:
+ CI: "1"
+ EXPO_NO_TELEMETRY: "1"
+ FASTLANE_SKIP_UPDATE_CHECK: "1"
+ FASTLANE_HIDE_CHANGELOG: "1"
+ FASTLANE_OPT_OUT_USAGE: "1"
+
+jobs:
+ prepare:
+ if: github.ref == 'refs/heads/main'
+ runs-on: blacksmith-2vcpu-ubuntu-2404
+ timeout-minutes: 5
+ outputs:
+ build_number: ${{ steps.release.outputs.build_number }}
+ platforms: ${{ steps.platforms.outputs.platforms }}
+ steps:
+ - uses: useblacksmith/checkout@v1
+ with:
+ persist-credentials: false
+ - uses: actions/setup-node@v7
+ with:
+ node-version-file: .nvmrc
+ - name: Validate signing setup and allocate version
+ id: release
+ env:
+ PLATFORM: ${{ inputs.platform }}
+ UPLOAD: ${{ inputs.upload }}
+ MOBILE_BUILD_NUMBER_BASE: ${{ vars.MOBILE_BUILD_NUMBER_BASE }}
+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+ ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
+ ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
+ ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
+ ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
+ IOS_DISTRIBUTION_P12_BASE64: ${{ secrets.IOS_DISTRIBUTION_P12_BASE64 }}
+ IOS_DISTRIBUTION_P12_PASSWORD: ${{ secrets.IOS_DISTRIBUTION_P12_PASSWORD }}
+ IOS_PROVISION_PROFILE_BASE64: ${{ secrets.IOS_PROVISION_PROFILE_BASE64 }}
+ GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
+ ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
+ ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
+ ASC_PRIVATE_KEY: ${{ secrets.ASC_PRIVATE_KEY }}
+ run: node tooling/mobile/release.ts
+ - name: Select platforms
+ id: platforms
+ env:
+ PLATFORM: ${{ inputs.platform }}
+ run: |
+ if [[ "$PLATFORM" == all ]]; then
+ echo 'platforms=["android","ios"]' >> "$GITHUB_OUTPUT"
+ else
+ jq -cn --arg platform "$PLATFORM" '{platforms: [$platform]}' \
+ | jq -r '"platforms=" + (.platforms | tojson)' >> "$GITHUB_OUTPUT"
+ fi
+
+ build:
+ needs: prepare
+ strategy:
+ fail-fast: false
+ matrix:
+ platform: ${{ fromJSON(needs.prepare.outputs.platforms) }}
+ runs-on: ${{ matrix.platform == 'ios' && 'blacksmith-6vcpu-macos-26' || 'blacksmith-8vcpu-ubuntu-2404' }}
+ timeout-minutes: 90
+ env:
+ PLATFORM: ${{ matrix.platform }}
+ MOBILE_BUILD_NUMBER: ${{ needs.prepare.outputs.build_number }}
+ BUNDLE_GEMFILE: ${{ github.workspace }}/tooling/mobile/Gemfile
+ steps:
+ - uses: useblacksmith/checkout@v1
+ with:
+ persist-credentials: false
+ - uses: pnpm/action-setup@v6
+ - uses: actions/setup-node@v7
+ with:
+ node-version-file: .nvmrc
+ cache: pnpm
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: "3.3"
+ bundler-cache: true
+ working-directory: tooling/mobile
+ - name: Check signing file handling
+ run: bundle exec ruby tooling/mobile/signing_test.rb
+ - uses: actions/setup-java@v5
+ if: matrix.platform == 'android'
+ with:
+ distribution: temurin
+ java-version: "17"
+ - uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4.0.4
+ if: matrix.platform == 'android'
+ - run: pnpm install --frozen-lockfile
+ - name: Check mobile source
+ run: |
+ pnpm --filter mobile typecheck
+ pnpm --filter mobile test
+ - uses: expo/expo-github-action@v9
+ with:
+ eas-version: 25.2.0
+ token: ${{ secrets.EXPO_TOKEN }}
+ - name: Fetch reviewed native Forme binaries
+ run: node packages/forme-native/scripts/fetch-prebuilt.mjs --platform "$PLATFORM"
+ - name: Build signed store binary with production environment
+ working-directory: apps/mobile
+ env:
+ ANDROID_KEYSTORE_BASE64: ${{ matrix.platform == 'android' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}
+ ANDROID_KEYSTORE_PASSWORD: ${{ matrix.platform == 'android' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}
+ ANDROID_KEY_ALIAS: ${{ matrix.platform == 'android' && secrets.ANDROID_KEY_ALIAS || '' }}
+ ANDROID_KEY_PASSWORD: ${{ matrix.platform == 'android' && secrets.ANDROID_KEY_PASSWORD || '' }}
+ IOS_DISTRIBUTION_P12_BASE64: ${{ matrix.platform == 'ios' && secrets.IOS_DISTRIBUTION_P12_BASE64 || '' }}
+ IOS_DISTRIBUTION_P12_PASSWORD: ${{ matrix.platform == 'ios' && secrets.IOS_DISTRIBUTION_P12_PASSWORD || '' }}
+ IOS_PROVISION_PROFILE_BASE64: ${{ matrix.platform == 'ios' && secrets.IOS_PROVISION_PROFILE_BASE64 || '' }}
+ run: |
+ eas env:exec production --non-interactive \
+ 'pnpm exec expo prebuild --platform "$PLATFORM" --clean --no-install && cd ../../tooling/mobile && bundle exec fastlane "$PLATFORM" build'
+ - name: Record native runtime fingerprint
+ working-directory: apps/mobile
+ run: |
+ eas fingerprint:generate --platform "$PLATFORM" --environment production --json --non-interactive \
+ > "$RUNNER_TEMP/mobile-release/fingerprint.json"
+ jq -n --arg sha "$GITHUB_SHA" --arg platform "$PLATFORM" --arg build "$MOBILE_BUILD_NUMBER" \
+ --arg xcode "$(if [[ "$PLATFORM" == ios ]]; then xcodebuild -version; fi)" \
+ '{commit: $sha, platform: $platform, buildNumber: $build, channel: "production", xcode: $xcode}' \
+ > "$RUNNER_TEMP/mobile-release/release.json"
+ - name: Save signed binary and debugging artifacts
+ uses: actions/upload-artifact@v7
+ with:
+ name: mobile-${{ matrix.platform }}-${{ needs.prepare.outputs.build_number }}
+ path: ${{ runner.temp }}/mobile-release/
+ if-no-files-found: error
+ retention-days: 14
+ - name: Summarize build
+ run: |
+ echo "### $PLATFORM build $MOBILE_BUILD_NUMBER" >> "$GITHUB_STEP_SUMMARY"
+ echo "Commit: $GITHUB_SHA. OTA channel: production. Fingerprint and debugging artifacts attached to this run." >> "$GITHUB_STEP_SUMMARY"
+
+ upload:
+ needs: [prepare, build]
+ if: inputs.upload
+ environment: mobile-store
+ strategy:
+ fail-fast: false
+ matrix:
+ platform: ${{ fromJSON(needs.prepare.outputs.platforms) }}
+ runs-on: ${{ matrix.platform == 'ios' && 'blacksmith-6vcpu-macos-26' || 'blacksmith-2vcpu-ubuntu-2404' }}
+ timeout-minutes: 30
+ env:
+ BUNDLE_GEMFILE: ${{ github.workspace }}/tooling/mobile/Gemfile
+ steps:
+ - uses: useblacksmith/checkout@v1
+ with:
+ persist-credentials: false
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: "3.3"
+ bundler-cache: true
+ working-directory: tooling/mobile
+ - uses: actions/download-artifact@v8
+ with:
+ name: mobile-${{ matrix.platform }}-${{ needs.prepare.outputs.build_number }}
+ path: ${{ runner.temp }}/mobile-release
+ - name: Upload without review or production rollout
+ working-directory: tooling/mobile
+ env:
+ PLATFORM: ${{ matrix.platform }}
+ GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ matrix.platform == 'android' && secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON || '' }}
+ ASC_KEY_ID: ${{ matrix.platform == 'ios' && secrets.ASC_KEY_ID || '' }}
+ ASC_ISSUER_ID: ${{ matrix.platform == 'ios' && secrets.ASC_ISSUER_ID || '' }}
+ ASC_PRIVATE_KEY: ${{ matrix.platform == 'ios' && secrets.ASC_PRIVATE_KEY || '' }}
+ run: bundle exec fastlane "$PLATFORM" upload
diff --git a/.gitignore b/.gitignore
index 15c3de733..e6cb292ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -77,6 +77,9 @@ temp
/apps/mobile/.expo
/apps/mobile/dist
/apps/mobile/expo-env.d.ts
+/tooling/mobile/.bundle/
+/tooling/mobile/vendor/
+/tooling/mobile/fastlane/report.xml
# Design exports live in Figma/Penpot; keep only runtime assets in source.
/apps/mobile/assets/launch-kit/
diff --git a/AGENTS.md b/AGENTS.md
index e60e1e268..36a9d8cea 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -132,7 +132,7 @@ Narrow cross-cutting helpers go in `packages/utils` only after checking no domai
## Native mobile app
- **Feature parity is required.** The web app and the native mobile app must always offer the same user-facing features. A change that adds, removes, or changes a feature in `apps/web` must make the matching change in `apps/mobile` in the same work, and the reverse. Share logic through workspace packages (`packages/api`, `packages/schema`, `packages/resume`, `packages/pdf`) rather than duplicating it. An exception forced by store policy (for example, the hidden iOS Donate row) needs the owner's explicit decision and a note in `docs/contributing/mobile-release-handoff.md`.
-- **Over-the-air update or new store build.** The runtime version uses an Expo fingerprint (`apps/mobile/fingerprint.config.js`). JavaScript, styling, copy, translation, and bundled-asset changes ship as an EAS Update: a stable Docker release publishes it to the `production` channel automatically, and no store submission is needed. A change to native code needs a new store build: native dependencies or config plugins, permissions or entitlements, `app.config.ts` native fields (icon, splash, schemes, associated domains), Expo SDK upgrades, `apps/mobile/patches`, or Forme native sources and `packages/forme-native/scripts/prebuilt.json`. Run `eas fingerprint:compare --build-id <last store build>` from `apps/mobile` to check. A changed fingerprint means a new store build. Release steps: `docs/contributing/mobile-release-handoff.md` → **Releasing a new version**.
+- **Over-the-air update or new store build.** The runtime version uses an Expo fingerprint (`apps/mobile/fingerprint.config.js`). JavaScript, styling, copy, translation, and bundled-asset changes ship as an EAS Update: a stable Docker release publishes it to the `production` channel automatically, and no store submission is needed. A change to native code needs a new store build: native dependencies or config plugins, permissions or entitlements, `app.config.ts` native fields (icon, splash, schemes, associated domains), Expo SDK upgrades, `apps/mobile/patches`, or Forme native sources and `packages/forme-native/scripts/prebuilt.json`. Run `eas fingerprint:compare <installed native fingerprint hash> --environment production` from `apps/mobile` to check; save each Blacksmith build's `fingerprint.json` with the store release record. A changed fingerprint means a new store build. Native binaries and optional store uploads use `.github/workflows/mobile-release.yml` on Blacksmith, not EAS Build/Submit. Setup: `docs/contributing/mobile-ci.md`. Release steps: `docs/contributing/mobile-release-handoff.md` → **Releasing a new version**.
- Old binaries and old OTA bundles stay in use for weeks. Keep API changes backward compatible, and deploy the backend before releasing mobile changes that depend on it. Never bump the runtime version to force an incompatible update onto old binaries.
## Package boundaries
diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts
index 386b9209e..b70c1ebaf 100644
--- a/apps/mobile/app.config.ts
+++ b/apps/mobile/app.config.ts
@@ -14,6 +14,7 @@ const config: ExpoConfig = {
runtimeVersion: { policy: "fingerprint" },
updates: {
url: "https://u.expo.dev/5830280e-e1ba-45b7-b9c9-ba048fa3bd4d",
+ requestHeaders: { "expo-channel-name": "production" },
checkAutomatically: "ON_LOAD",
fallbackToCacheTimeout: 0,
},
@@ -21,6 +22,7 @@ const config: ExpoConfig = {
orientation: "default",
userInterfaceStyle: "automatic",
ios: {
+ buildNumber: process.env.MOBILE_BUILD_NUMBER ?? "1",
icon: {
light: "./assets/icon.png",
dark: "./assets/icon-dark.png",
@@ -57,6 +59,7 @@ const config: ExpoConfig = {
associatedDomains: [`applinks:${host}`, `webcredentials:${host}`],
},
android: {
+ versionCode: Number(process.env.MOBILE_BUILD_NUMBER ?? "1"),
package: "me.rxresu",
predictiveBackGestureEnabled: false,
adaptiveIcon: {
diff --git a/apps/mobile/scripts/layout.test.mjs b/apps/mobile/scripts/layout.test.mjs
index e281f27bc..01e0032a3 100644
--- a/apps/mobile/scripts/layout.test.mjs
+++ b/apps/mobile/scripts/layout.test.mjs
@@ -41,6 +41,7 @@ const mocks = {
"react-native-safe-area-context": safe,
"@lingui/react/macro": { useLingui: () => ({ t: tag }) },
"expo-router": { useRouter: () => router, usePathname: () => "/documents" },
+ "expo-observe": { useObserve: () => ({ markInteractive() {} }) },
"react-native-keyboard-controller": { useKeyboardState: () => false },
"@/routes": { routes },
};
diff --git a/docs/contributing/mobile-ci.md b/docs/contributing/mobile-ci.md
new file mode 100644
index 000000000..04b6a3a0a
--- /dev/null
+++ b/docs/contributing/mobile-ci.md
@@ -0,0 +1,130 @@
+# Native releases on Blacksmith
+
+The **Mobile Release** GitHub Actions workflow builds Android on Blacksmith Linux and
+iOS on Blacksmith Apple Silicon macOS. Expo Prebuild generates native projects; Gradle
+and Xcode compile them; Fastlane signs and optionally uploads them. It does not call
+EAS Build or EAS Submit. EAS Update still delivers compatible OTA updates through the
+existing Docker release workflow.
+
+Setup verified on **2026-10-21**: all eleven signing/upload secrets were copied from
+existing EAS credentials into repository Actions secrets; the existing `EXPO_TOKEN`
+was retained. `MOBILE_BUILD_NUMBER_BASE` is **100**. Live store counters were iOS **6**
+and Android **8**; workflow run 1, attempt 1 will allocate **100**. Environment
+`mobile-store` requires approval from `amruthpillai`, allows self-review, disallows admin
+bypass, and accepts only branch `main`. The workflow is manually dispatched after its
+changes reach `main`; no Blacksmith app build or store upload was run during setup.
+
+## One-time migration
+
+Enable Blacksmith for this repository and confirm your plan covers macOS runners.
+The workflow uses `blacksmith-6vcpu-macos-26` with the image's default Xcode and records
+its version in each iOS artifact. Check Apple's current minimum SDK requirements before
+uploading. Ruby, Fastlane and CocoaPods dependencies are locked under `tooling/mobile`.
+
+Download the **existing** Android upload keystore and iOS distribution certificate
+(including its private key) and App Store provisioning profile using `eas credentials`
+from `apps/mobile`. Do not generate replacement signing identities for this migration.
+If using that CLI for iOS, set `EXPO_NO_CAPABILITY_SYNC=1`: Apple capabilities remain
+managed manually. Native Apple sign-in uses the web Services ID `me.rxresu.web`;
+neither this workflow nor Fastlane changes capabilities in Apple's portal.
+
+Save these as **repository Actions secrets**, using GitHub's settings or a secure local
+file as input to `gh secret set`. Never paste credentials into chat, source, logs or
+workflow artifacts. Base64 is encoding, not encryption.
+
+- `EXPO_TOKEN`: existing token, retained for production environment variables and OTA tooling.
+- `ANDROID_KEYSTORE_BASE64`: base64 of the existing Android upload `.jks`.
+- `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD`:
+ existing upload-keystore values.
+- `IOS_DISTRIBUTION_P12_BASE64`: base64 of an Apple Distribution `.p12` containing
+ the certificate and private key.
+- `IOS_DISTRIBUTION_P12_PASSWORD`: password for that `.p12`.
+- `IOS_PROVISION_PROFILE_BASE64`: base64 of the App Store profile for `me.rxresu`,
+ team `654ASRW868`, covering the current app entitlements and certificate.
+- `GOOGLE_PLAY_SERVICE_ACCOUNT_JSON`: raw service-account JSON with release-to-testing
+ permission for this app. Required only for Android uploads.
+- `ASC_KEY_ID`, `ASC_ISSUER_ID`, `ASC_PRIVATE_KEY`: App Store Connect team API key ID,
+ issuer UUID, and raw `.p8` private key. Required only for iOS uploads.
+
+Play App Signing retains its existing app-signing certificate. Do not replace
+`MOBILE_ANDROID_CERT_SHA256` with the upload-keystore fingerprint. Keep bundle/package
+ID `me.rxresu`, Apple team, keychain groups, and associated domains unchanged.
+
+Set repository Actions variable `MOBILE_BUILD_NUMBER_BASE` to an integer **greater than
+every build number/version code already allocated in EAS or uploaded to either store**.
+Read current counters; do not use the historical 4/5 values in the handoff as live data.
+The workflow allocates both platforms' versions as:
+
+```text
+MOBILE_BUILD_NUMBER_BASE + (GITHUB_RUN_NUMBER - 1) * 100 + (GITHUB_RUN_ATTEMPT - 1)
+```
+
+The first run starts at the configured base: base 100 allocates 100 on attempt 1,
+101 on attempt 2, and 200 on run 2's first attempt. This reserves 99 attempts per run
+and fails before compilation on missing/invalid
+configuration or Android's 2,100,000,000 limit. Never decrease the base or reset the
+workflow counter. Rerunning an older run after a newer upload can produce an older
+version; dispatch a fresh run instead. Stop EAS store builds after migration so two
+systems do not allocate competing versions. `eas.json` remains legacy configuration;
+its remote counters and auto-increment do not govern this workflow.
+
+Create GitHub environment **`mobile-store`**, restrict deployment branches to `main`,
+and configure required reviewers if you want an approval before uploads. Merely naming
+an environment does not enable required reviewers. Both workflow signing and upload
+paths are manual, and signing is limited to `main`.
+
+## Build and upload
+
+1. Deploy backward-compatible backend changes first. Update app `version` in
+ `apps/mobile/app.config.ts` when needed; iOS requires a new version string after a
+ version has been released. CI supplies the build number automatically.
+2. Dispatch **Mobile Release** on `main`, choose `all`, `android`, or `ios`, and leave
+ **upload** disabled for the first signing check. The workflow validates credentials,
+ runs mobile source checks, fetches checksum-pinned Forme binaries, loads the EAS
+ `production` environment, and generates fresh native projects.
+3. Inspect the signed artifacts, embedded production update channel, signing identities,
+ versions, entitlements and native runtime. Artifacts include `release.json`,
+ `fingerprint.json`, available source maps, and iOS symbols. Raw build logs are not
+ uploaded because toolchains can include environment values in them. Download the
+ fingerprint and keep it with the store release record before the 14-day Actions
+ retention expires. Binaries stay in workflow artifacts; no GitHub Release assets
+ or public sideload distribution are created.
+4. Dispatch with **upload** enabled when ready. Upload jobs start only after every
+ selected platform built successfully, then pass the `mobile-store` environment gate.
+ They upload the exact signed artifacts from that run. Android goes to an **internal
+ draft**; iOS uploads to App Store Connect without external tester distribution or
+ App Review submission. Upload success does not prove store processing succeeded.
+5. Finish TestFlight/Play tester distribution, signed-device QA, store declarations,
+ review submission and production rollout in the consoles. Follow the
+ [release handoff](./mobile-release-handoff.md#signed-device-test-matrix).
+
+CI creates temporary signing files with restrictive permissions, imports the Apple
+certificate into a temporary keychain, and removes the profile, keychain and temporary
+files after the build. It never invokes capability synchronization or provisions new
+Apple resources. Renew certificates/profiles before expiry and update Actions secrets.
+
+## OTA compatibility and observability
+
+The update URL, EAS project and fingerprint policy remain unchanged. The production
+channel is explicitly embedded through `updates.requestHeaders`; setting a channel in
+`eas.json` alone does not configure a build produced outside EAS Build. Build numbers
+are excluded from Expo's normalized config fingerprint. Native project output and
+generated Forme binaries remain excluded through `fingerprint.config.js`; reviewed
+native sources and binary pins still determine compatibility.
+
+After the first store-installed Blacksmith build, publish a matching OTA update through
+the normal Docker release path, download it, restart the app and verify saved drafts on
+both platforms. A native change requires a new store binary. Existing binaries keep
+receiving updates for their compatible runtime; never force a runtime match.
+
+EAS Observe instrumentation remains bundled. However, Expo currently supports native
+embedded-bundle source-map uploads only for builds on EAS Build servers, so the new
+embedded bundles do not have that managed symbolication/build-dashboard linkage.
+Keep the generated maps/symbols for debugging. The Docker workflow still uses
+`eas update --upload-source-maps`, preserving source-map uploads for OTA bundles.
+No new monitoring service is introduced.
+
+References: [Expo local production builds](https://docs.expo.dev/guides/local-app-production/),
+[standalone EAS Update](https://docs.expo.dev/eas-update/standalone-service/),
+[Observe error reporting](https://docs.expo.dev/eas/observe/errors/),
+[Blacksmith runner images](https://docs.blacksmith.sh/blacksmith-runners/overview).
diff --git a/docs/contributing/mobile-release-handoff.md b/docs/contributing/mobile-release-handoff.md
index 472f98b7b..f97d0f764 100644
--- a/docs/contributing/mobile-release-handoff.md
+++ b/docs/contributing/mobile-release-handoff.md
@@ -1,6 +1,6 @@
# Mobile release handoff
-Last updated: **2026-10-18**. Branch: `mobile/native-app`. **Not ready for store submission yet.** Uploaded binaries, saved listing drafts, passing source checks, production deployment, device verification, and store approval are separate states.
+Release workflow updated: **2026-10-21**. Store observations below remain historical unless dated otherwise. **Not ready for store submission yet.** Uploaded binaries, saved listing drafts, passing source checks, production deployment, device verification, and store approval are separate states.
This is the operational handoff. See [mobile-store-review.md](./mobile-store-review.md) for policy sources, detailed verification history, report-queue SQL, and issue triage; see [store metadata](../../apps/mobile/store/README.md) for localization mappings.
@@ -74,11 +74,12 @@ One-time activation:
2. From `apps/mobile`, create `preview` and `production` channels with
`eas channel:create preview --non-interactive` and
`eas channel:create production --non-interactive` if they do not already exist.
-3. Build `preview` for internal testing and `production` for store distribution on both
- platforms. These builds replace earlier binaries without `expo-updates`; complete the
- store/device gates in this document before production release.
-4. Publish a preview update, install the matching build, open it to download, then restart
- to apply. Verify startup offline and saved drafts. Repeat on iOS and Android.
+3. Configure [Blacksmith native releases](./mobile-ci.md), then build store binaries on
+ both platforms. These builds explicitly embed the `production` update channel;
+ complete the store/device gates in this document before production release.
+4. Publish a production update through the Docker release workflow, install the matching
+ store build, open it to download, then restart to apply. Verify startup offline and
+ saved drafts. Repeat on iOS and Android. Existing preview binaries keep their channel.
The Docker workflow publishes from the image's exact source commit: non-production
images go to preview, stable releases to production after SSH deployment and three
@@ -137,34 +138,26 @@ Protected Apple deployment values are local at `/Users/amruth/.config/rxresu/app
## Releasing a new version
-Decide first whether the change needs a store build. Run this from `apps/mobile`:
+Decide first whether the change needs a store build. Compare the saved platform hash
+from the installed Blacksmith build's `fingerprint.json` with the current production
+fingerprint, from `apps/mobile`:
```sh
-eas fingerprint:compare --build-id <EAS build ID of the current store binary>
+eas fingerprint:compare <INSTALLED_NATIVE_FINGERPRINT_HASH> --environment production
```
**Fingerprint unchanged (JavaScript-only change):** no store work. A stable Docker release publishes the update to the `production` channel after the deployment health probes pass (see [Over-the-air updates](#over-the-air-updates)). Apps download it on launch and apply it on the next restart. OTA updates must not change the app's primary purpose or add features that need new store declarations; ship those through review.
-**Fingerprint changed (native change):** build and submit new binaries.
+For an older EAS-built binary, `--build-id <EAS build ID>` remains supported instead
+of the hash. Compare both platforms. Keep API changes backward compatible with older
+binaries and deploy the backend first.
-1. Deploy the backend first. Keep the API backward compatible: older binaries and OTA bundles remain in use.
-2. Optionally bump `version` in `apps/mobile/app.config.ts` (for example `1.0.0` to `1.1.0`). Do not edit build numbers: `appVersionSource` is `remote` and the production profile auto-increments the iOS build number and Android `versionCode`. iOS needs a new version string after a version is released; Play needs only a higher `versionCode`.
-3. Build both platforms:
-
- ```sh
- EXPO_NO_CAPABILITY_SYNC=1 eas build --profile production --platform all
- ```
-
- Always set `EXPO_NO_CAPABILITY_SYNC=1` for iOS builds and `eas credentials`. The app has no native Sign in with Apple entitlement (Apple sign-in runs through the web flow with Services ID `me.rxresu.web`), so capability sync tries to turn Sign in with Apple off for App ID `me.rxresu`. Apple refuses because the Services ID uses that App ID as its primary app, and turning it off would break Apple sign-in. Manage capabilities manually in the Apple developer console.
+**Fingerprint changed (native change):** build and upload new binaries.
-4. Submit the latest builds. Use `--auto-submit` on the build command to combine steps 3 and 4.
-
- ```sh
- eas submit --profile production --platform ios --latest
- eas submit --profile production --platform android --latest
- ```
-
- Both platforms submit with keys stored in EAS credentials, so submission also works from CI: the App Store Connect API key for iOS, and the Google service-account key (scoped to this app with release-to-testing permission in Play Console) for Android. `eas.json` holds no credential paths. Never commit credential files.
+1. Deploy the backend first. Keep the API backward compatible: older binaries and OTA bundles remain in use.
+2. Optionally bump `version` in `apps/mobile/app.config.ts` (for example `1.0.0` to `1.1.0`). CI supplies increasing iOS build numbers and Android version codes. iOS needs a new version string after a version is released; Play needs only a higher `versionCode`.
+3. Dispatch **Mobile Release** on `main`, platform `all`. The [Blacksmith setup guide](./mobile-ci.md) covers migrating existing signing credentials, seeding `MOBILE_BUILD_NUMBER_BASE`, and configuring the `mobile-store` approval environment. Build without uploads first to verify signing. No EAS Build credits are used.
+4. Dispatch with **upload** enabled to send the signed artifacts to App Store Connect and Play's internal draft track. This does not submit App Review, distribute to external testers, or publish a production release. Fastlane signs locally using existing credentials and does not synchronize Apple capabilities. If exporting credentials through `eas credentials`, keep `EXPO_NO_CAPABILITY_SYNC=1`; Apple sign-in uses web Services ID `me.rxresu.web`, so turning off its primary App ID's Sign in with Apple capability would break sign-in.
5. **App Store Connect:** wait for processing, test through TestFlight, create the new app version, attach the build, write "What's New", and submit for review. Release manually or automatically after approval.
6. **Play Console:** the build lands in the `internal` track as a draft. Roll it out to testers, then promote it to production with release notes. Use a staged rollout for risky changes.
@@ -186,11 +179,11 @@ Distribution is store-only. No IPA, AAB, or APK is attached to GitHub Releases.
Earlier builds are superseded. Local IPA/AAB/inspection outputs and evidence are under `/tmp/rxresu-store-artifacts`; listing verification is under `/tmp/reactive-resume-listing-audit`. These are temporary local evidence, not durable build storage. Retrieve store artifacts through EAS links if local files disappear. The inspection APK is debug-signed solely for inspection; it does not prove Play-installed identity or behavior.
-EAS project is `reactive-resume/reactive-resume`, ID `5830280e-e1ba-45b7-b9c9-ba048fa3bd4d`. Versions are remote with production auto-increment; do not reset counters to 4/5 when rebuilding. Capability sync must stay disabled with `EXPO_NO_CAPABILITY_SYNC=1` (see [Releasing a new version](#releasing-a-new-version)); Apple capabilities are configured manually. The flag does not provision missing capabilities.
+EAS project is `reactive-resume/reactive-resume`, ID `5830280e-e1ba-45b7-b9c9-ba048fa3bd4d`, retained for OTA updates and Observe. The historical EAS builds used remote version counters; Blacksmith uses the GitHub counter and migration offset described in [mobile-ci.md](./mobile-ci.md). Never reset versions to 4/5. Apple capabilities remain manually configured; `EXPO_NO_CAPABILITY_SYNC=1` is still required when using `eas credentials`.
-`apps/mobile/eas.json` holds no credential paths; submission keys live in EAS credentials. iOS upload used an existing developer API key, while distribution signing required an approved Admin team key. Android's first AAB upload was done manually; later submissions use the Google service-account key stored in EAS credentials. Never commit credential files. Expo Doctor passed 20/20 after adding direct `expo-asset` dependency.
+Historically, submission keys lived in EAS credentials and `apps/mobile/eas.json` held no credential paths. Blacksmith requires exporting those existing signing credentials and storing upload keys in Actions secrets. iOS upload used an existing developer API key, while distribution signing required an approved Admin team key. Android's first AAB upload was manual. Never commit credential files. Historical Expo Doctor result: 20/20 after adding direct `expo-asset` dependency.
-Forme native artifacts are published and checksum-pinned in `packages/forme-native/scripts/prebuilt.json`; EAS pre-install fetches them. A source/ABI change needs matching published prebuilts and checksum updates. Do not replace the pin with an unverified download or assume package version alone identifies native content.
+Forme native artifacts are published and checksum-pinned in `packages/forme-native/scripts/prebuilt.json`; the Blacksmith build explicitly fetches them before prebuild. A source/ABI change needs matching published prebuilts and checksum updates. Do not replace the pin with an unverified download or assume package version alone identifies native content.
## Signed-device test matrix
diff --git a/tooling/mobile/Gemfile b/tooling/mobile/Gemfile
new file mode 100644
index 000000000..86c131e72
--- /dev/null
+++ b/tooling/mobile/Gemfile
@@ -0,0 +1,4 @@
+source "https://rubygems.org"
+
+gem "fastlane", "2.241.1"
+gem "cocoapods", "1.17.0"
diff --git a/tooling/mobile/Gemfile.lock b/tooling/mobile/Gemfile.lock
new file mode 100644
index 000000000..0ffbee287
--- /dev/null
+++ b/tooling/mobile/Gemfile.lock
@@ -0,0 +1,365 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ CFPropertyList (3.0.8)
+ abbrev (0.1.2)
+ activesupport (7.2.4)
+ base64
+ benchmark (>= 0.3)
+ bigdecimal
+ concurrent-ruby (~> 1.0, >= 1.3.1)
+ connection_pool (>= 2.2.5, < 3)
+ drb
+ i18n (>= 1.6, < 2)
+ logger (>= 1.4.2)
+ minitest (>= 5.1, < 6)
+ securerandom (>= 0.3)
+ tzinfo (~> 2.0, >= 2.0.5)
+ addressable (2.9.0)
+ public_suffix (>= 2.0.2, < 8.0)
+ algoliasearch (1.27.5)
+ httpclient (~> 2.8, >= 2.8.3)
+ json (>= 1.5.1)
+ artifactory (3.0.17)
+ atomos (0.1.3)
+ aws-eventstream (1.4.0)
+ aws-partitions (1.1296.0)
+ aws-sdk-core (3.259.0)
+ aws-eventstream (~> 1, >= 1.3.0)
+ aws-partitions (~> 1, >= 1.992.0)
+ aws-sigv4 (~> 1.9)
+ base64
+ bigdecimal
+ jmespath (~> 1, >= 1.6.1)
+ logger
+ rexml (~> 3.4, >= 3.4.2)
+ aws-sdk-kms (1.134.0)
+ aws-sdk-core (~> 3, >= 3.258.0)
+ aws-sigv4 (~> 1.5)
+ aws-sdk-s3 (1.235.0)
+ aws-sdk-core (~> 3, >= 3.258.0)
+ aws-sdk-kms (~> 1)
+ aws-sigv4 (~> 1.5)
+ aws-sigv4 (1.12.1)
+ aws-eventstream (~> 1, >= 1.0.2)
+ babosa (1.0.4)
+ base64 (0.3.0)
+ benchmark (0.5.0)
+ bigdecimal (4.1.3)
+ cgi (0.5.2)
+ claide (1.1.0)
+ cocoapods (1.17.0)
+ addressable (~> 2.8)
+ claide (>= 1.0.2, < 2.0)
+ cocoapods-core (= 1.17.0)
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
+ cocoapods-downloader (>= 2.1, < 3.0)
+ cocoapods-plugins (>= 1.0.0, < 2.0)
+ cocoapods-search (>= 1.0.0, < 2.0)
+ cocoapods-trunk (>= 1.6.0, < 2.0)
+ cocoapods-try (>= 1.1.0, < 2.0)
+ colored2 (~> 3.1)
+ fourflusher (>= 2.3.0, < 3.0)
+ gh_inspector (~> 1.0)
+ molinillo (~> 0.8.0)
+ nap (~> 1.0)
+ ruby-macho (~> 4.1.0)
+ xcodeproj (>= 1.28.1, < 2.0)
+ cocoapods-core (1.17.0)
+ activesupport (>= 5.0, < 8)
+ addressable (~> 2.8)
+ algoliasearch (~> 1.0)
+ concurrent-ruby (~> 1.1)
+ fuzzy_match (~> 2.0.4)
+ nap (~> 1.0)
+ netrc (~> 0.11)
+ public_suffix (~> 4.0)
+ typhoeus (~> 1.0)
+ cocoapods-deintegrate (1.0.5)
+ cocoapods-downloader (2.1)
+ cocoapods-plugins (1.0.0)
+ nap
+ cocoapods-search (1.0.1)
+ cocoapods-trunk (1.6.0)
+ nap (>= 0.8, < 2.0)
+ netrc (~> 0.11)
+ cocoapods-try (1.2.0)
+ colored (1.2)
+ colored2 (3.1.2)
+ commander (4.6.0)
+ highline (~> 2.0.0)
+ concurrent-ruby (1.3.8)
+ connection_pool (2.5.5)
+ csv (3.3.6)
+ declarative (0.0.20)
+ digest-crc (0.7.0)
+ rake (>= 12.0.0, < 14.0.0)
+ domain_name (0.7.20261007)
+ dotenv (2.8.1)
+ drb (2.2.3)
+ emoji_regex (3.2.3)
+ erb (6.0.7)
+ ethon (0.18.0)
+ ffi (>= 1.15.0)
+ logger
+ excon (1.7.3)
+ logger
+ faraday (2.15.0)
+ faraday-net_http (>= 2.0, < 3.6)
+ json
+ logger
+ faraday-cookie_jar (0.0.8)
+ faraday (>= 0.8.0)
+ http-cookie (>= 1.0.0)
+ faraday-follow_redirects (0.5.0)
+ faraday (>= 1, < 3)
+ faraday-multipart (1.2.0)
+ multipart-post (~> 2.0)
+ faraday-net_http (3.5.0)
+ net-http (~> 0.5)
+ faraday-retry (2.4.0)
+ faraday (~> 2.0)
+ fastimage (2.4.1)
+ fastlane (2.241.1)
+ CFPropertyList (>= 2.3, < 5.0.0)
+ abbrev (~> 0.1)
+ addressable (>= 2.9.0, < 3.0.0)
+ artifactory (~> 3.0)
+ aws-sdk-s3 (~> 1.197)
+ babosa (>= 1.0.3, < 2.0.0)
+ base64 (~> 0.2)
+ benchmark (>= 0.1.0)
+ bundler (>= 2.4.0, < 5.0.0)
+ cgi (~> 0.4)
+ colored (~> 1.2)
+ commander (~> 4.6)
+ csv (~> 3.3)
+ dotenv (>= 2.1.1, < 3.0.0)
+ emoji_regex (>= 0.1, < 4.0)
+ erb (>= 4.0, < 7.0)
+ excon (>= 1.0.0, < 2.0.0)
+ faraday (~> 2.7)
+ faraday-cookie_jar (~> 0.0.8)
+ faraday-follow_redirects (~> 0.3)
+ faraday-multipart (~> 1.0)
+ faraday-retry (~> 2.0)
+ fastimage (>= 2.1.0, < 3.0.0)
+ fastlane-sirp (>= 1.1.0)
+ gh_inspector (>= 1.1.2, < 2.0.0)
+ google-apis-androidpublisher_v3 (~> 0.99)
+ google-apis-playcustomapp_v1 (~> 0.1)
+ google-cloud-env (>= 1.6.0, < 2.5.0)
+ google-cloud-storage (~> 1.31)
+ highline (~> 2.0)
+ irb (>= 1.8)
+ json (< 3.0.0)
+ jwt (>= 2.10.3, < 4)
+ logger (>= 1.6, < 2.0)
+ mini_magick (>= 4.9.4, < 5.0.0)
+ multi_json (~> 1.12)
+ multipart-post (>= 2.0.0, < 3.0.0)
+ mutex_m (~> 0.3)
+ naturally (~> 2.2)
+ nkf (~> 0.2)
+ optparse (>= 0.1.1, < 1.0.0)
+ ostruct (>= 0.1.0)
+ plist (>= 3.1.0, < 4.0.0)
+ rubyzip (>= 3.4.0, < 4.0.0)
+ security (~> 0.3)
+ simctl (~> 1.6.3)
+ terminal-notifier (>= 3.1.0, < 4.0.0)
+ terminal-table (~> 4)
+ tty-screen (>= 0.6.3, < 1.0.0)
+ tty-spinner (>= 0.8.0, < 1.0.0)
+ word_wrap (~> 1.0.0)
+ xcodeproj (>= 1.13.0, < 2.0.0)
+ xcpretty (~> 0.4.1)
+ xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
+ fastlane-sirp (1.1.0)
+ ffi (1.17.4)
+ ffi (1.17.4-aarch64-linux-gnu)
+ ffi (1.17.4-aarch64-linux-musl)
+ ffi (1.17.4-arm-linux-gnu)
+ ffi (1.17.4-arm-linux-musl)
+ ffi (1.17.4-arm64-darwin)
+ ffi (1.17.4-x86-linux-gnu)
+ ffi (1.17.4-x86-linux-musl)
+ ffi (1.17.4-x86_64-darwin)
+ ffi (1.17.4-x86_64-linux-gnu)
+ ffi (1.17.4-x86_64-linux-musl)
+ fourflusher (2.3.1)
+ fuzzy_match (2.0.4)
+ gh_inspector (1.1.3)
+ google-apis-androidpublisher_v3 (0.109.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-apis-core (1.3.2)
+ addressable (~> 2.9)
+ faraday (~> 2.13)
+ faraday-follow_redirects (~> 0.3)
+ googleauth (~> 1.14)
+ mini_mime (~> 1.1)
+ multi_json (~> 1.11)
+ representable (~> 3.0)
+ retriable (>= 3.1, < 5.0)
+ google-apis-iamcredentials_v1 (0.28.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-apis-playcustomapp_v1 (0.18.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-apis-storage_v1 (0.69.0)
+ google-apis-core (>= 0.15.0, < 2.a)
+ google-cloud-core (1.9.0)
+ google-cloud-env (>= 1.0, < 3.a)
+ google-cloud-errors (~> 1.0)
+ google-cloud-env (2.4.1)
+ base64 (~> 0.2)
+ faraday (>= 1.0, < 3.a)
+ google-cloud-errors (1.7.0)
+ google-cloud-storage (1.62.1)
+ addressable (~> 2.8)
+ digest-crc (~> 0.4)
+ google-apis-core (>= 0.18, < 2)
+ google-apis-iamcredentials_v1 (~> 0.18)
+ google-apis-storage_v1 (>= 0.42)
+ google-cloud-core (~> 1.6)
+ googleauth (~> 1.9)
+ mini_mime (~> 1.0)
+ google-logging-utils (0.2.1)
+ googleauth (1.17.6)
+ faraday (>= 1.0, < 3.a)
+ google-cloud-env (~> 2.2)
+ google-logging-utils (~> 0.1)
+ jwt (>= 1.4, < 4.0)
+ os (>= 0.9, < 2.0)
+ pstore (~> 0.1)
+ signet (>= 0.16, < 2.a)
+ highline (2.0.3)
+ http-cookie (1.1.6)
+ domain_name (~> 0.5)
+ httpclient (2.9.0)
+ mutex_m
+ i18n (1.15.2)
+ concurrent-ruby (~> 1.0)
+ io-console (0.9.4)
+ irb (1.18.0)
+ pp (>= 0.6.0)
+ prism (>= 1.3.0)
+ rdoc (>= 4.0.0)
+ reline (>= 0.4.2)
+ jmespath (1.6.2)
+ json (2.21.2)
+ jwt (3.3.0)
+ base64
+ logger (1.7.0)
+ mini_magick (4.13.2)
+ mini_mime (1.1.5)
+ minitest (5.27.0)
+ molinillo (0.8.0)
+ multi_json (1.21.2)
+ multipart-post (2.4.1)
+ mutex_m (0.3.0)
+ nanaimo (0.4.0)
+ nap (1.1.0)
+ naturally (2.3.0)
+ net-http (0.10.0)
+ net-protocol (>= 0.3.0)
+ uri (>= 0.11.1)
+ net-protocol (0.4.0)
+ timeout
+ netrc (0.11.0)
+ nkf (0.3.0)
+ optparse (0.8.1)
+ os (1.1.4)
+ ostruct (0.6.3)
+ plist (3.7.2)
+ pp (0.6.4)
+ prettyprint
+ prettyprint (0.2.1)
+ prism (1.9.0)
+ pstore (0.2.1)
+ public_suffix (4.0.7)
+ rake (13.4.2)
+ rbs (4.2.0)
+ logger
+ prism (>= 1.6.0)
+ tsort
+ rdoc (8.1.0)
+ erb
+ prism (>= 1.6.0)
+ rbs (>= 4.0.0)
+ tsort
+ reline (0.7.0)
+ io-console (~> 0.5)
+ representable (3.3.1)
+ declarative (< 0.1.0)
+ trailblazer-option (>= 0.1.1, < 0.2.0)
+ uber (< 0.2.0)
+ retriable (4.2.0)
+ rexml (3.4.4)
+ rouge (3.28.0)
+ ruby-macho (4.1.0)
+ rubyzip (3.7.0)
+ securerandom (0.4.1)
+ security (0.3.0)
+ signet (0.22.1)
+ addressable (~> 2.8)
+ faraday (>= 0.17.5, < 3.a)
+ jwt (>= 1.5, < 4.0)
+ simctl (1.6.10)
+ CFPropertyList
+ naturally
+ terminal-notifier (3.1.0)
+ terminal-table (4.0.0)
+ unicode-display_width (>= 1.1.1, < 4)
+ timeout (0.6.1)
+ trailblazer-option (0.1.2)
+ tsort (0.2.0)
+ tty-cursor (0.7.1)
+ tty-screen (0.8.2)
+ tty-spinner (0.9.3)
+ tty-cursor (~> 0.7)
+ typhoeus (1.6.0)
+ ethon (>= 0.18.0)
+ tzinfo (2.0.6)
+ concurrent-ruby (~> 1.0)
+ uber (0.1.0)
+ unicode-display_width (3.3.0)
+ unicode-emoji (~> 4.3)
+ unicode-emoji (4.3.0)
+ uri (1.1.2)
+ word_wrap (1.0.0)
+ xcodeproj (1.28.1)
+ CFPropertyList (>= 2.3.3, < 4.0)
+ atomos (~> 0.1.3)
+ base64
+ claide (>= 1.0.2, < 2.0)
+ colored2 (~> 3.1)
+ nanaimo (~> 0.4.0)
+ nkf
+ rexml (>= 3.3.6, < 4.0)
+ xcpretty (0.4.1)
+ rouge (~> 3.28.0)
+ xcpretty-travis-formatter (1.0.1)
+ xcpretty (~> 0.2, >= 0.0.7)
+
+PLATFORMS
+ aarch64-linux
+ aarch64-linux-gnu
+ aarch64-linux-musl
+ arm-linux-gnu
+ arm-linux-musl
+ arm64-darwin
+ arm64-darwin-27
+ ruby
+ x86-linux-gnu
+ x86-linux-musl
+ x86_64-darwin
+ x86_64-linux
+ x86_64-linux-gnu
+ x86_64-linux-musl
+
+DEPENDENCIES
+ cocoapods (= 1.17.0)
+ fastlane (= 2.241.1)
+
+BUNDLED WITH
+ 2.7.2
diff --git a/tooling/mobile/fastlane/Fastfile b/tooling/mobile/fastlane/Fastfile
new file mode 100644
index 000000000..87495c877
--- /dev/null
+++ b/tooling/mobile/fastlane/Fastfile
@@ -0,0 +1,116 @@
+require "base64"
+require "fileutils"
+require "securerandom"
+require "tmpdir"
+
+ROOT = File.expand_path("../../..", __dir__)
+MOBILE = File.join(ROOT, "apps/mobile")
+OUTPUT = File.join(ENV.fetch("RUNNER_TEMP"), "mobile-release")
+
+def secret_file(directory, name, value, base64: false)
+ path = File.join(directory, name)
+ File.write(path, base64 ? Base64.strict_decode64(value.gsub(/\s/, "")) : value, mode: "wb", perm: 0600)
+ path
+end
+
+platform :android do
+ desc "Build a signed production App Bundle"
+ lane :build do
+ FileUtils.mkdir_p(OUTPUT)
+ Dir.mktmpdir("android-signing-", ENV.fetch("RUNNER_TEMP")) do |directory|
+ keystore = secret_file(directory, "upload.jks", ENV.fetch("ANDROID_KEYSTORE_BASE64"), base64: true)
+ gradle(
+ project_dir: File.join(MOBILE, "android"),
+ task: "bundle", build_type: "Release", flags: "--no-daemon",
+ print_command: false,
+ properties: {
+ "android.injected.signing.store.file" => keystore,
+ "android.injected.signing.store.password" => ENV.fetch("ANDROID_KEYSTORE_PASSWORD"),
+ "android.injected.signing.key.alias" => ENV.fetch("ANDROID_KEY_ALIAS"),
+ "android.injected.signing.key.password" => ENV.fetch("ANDROID_KEY_PASSWORD")
+ }
+ )
+ FileUtils.cp(lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH], File.join(OUTPUT, "ReactiveResume.aab"))
+ maps = File.join(MOBILE, "android/app/build/generated/sourcemaps/react/release")
+ FileUtils.cp_r(maps, File.join(OUTPUT, "sourcemaps")) if Dir.exist?(maps)
+ end
+ end
+
+ desc "Upload only to a draft on Play's internal track"
+ lane :upload do
+ upload_to_play_store(
+ package_name: "me.rxresu",
+ aab: File.join(OUTPUT, "ReactiveResume.aab"),
+ json_key_data: ENV.fetch("GOOGLE_PLAY_SERVICE_ACCOUNT_JSON"),
+ track: "internal", release_status: "draft",
+ skip_upload_apk: true, skip_upload_metadata: true, skip_upload_changelogs: true,
+ skip_upload_images: true, skip_upload_screenshots: true
+ )
+ end
+end
+
+platform :ios do
+ desc "Archive and export a signed production IPA with existing Apple capabilities"
+ lane :build do
+ FileUtils.mkdir_p(OUTPUT)
+ keychain = "mobile-#{ENV.fetch('GITHUB_RUN_ID')}-#{ENV.fetch('GITHUB_RUN_ATTEMPT')}"
+ keychain_password = SecureRandom.hex(32)
+ create_keychain(name: keychain, password: keychain_password, default_keychain: false, unlock: true, timeout: 0)
+ begin
+ Dir.mktmpdir("ios-signing-", ENV.fetch("RUNNER_TEMP")) do |directory|
+ certificate = secret_file(directory, "distribution.p12", ENV.fetch("IOS_DISTRIBUTION_P12_BASE64"), base64: true)
+ profile = secret_file(directory, "app.mobileprovision", ENV.fetch("IOS_PROVISION_PROFILE_BASE64"), base64: true)
+ import_certificate(
+ certificate_path: certificate, certificate_password: ENV.fetch("IOS_DISTRIBUTION_P12_PASSWORD"),
+ keychain_name: keychain, keychain_password: keychain_password
+ )
+ installed = install_provisioning_profile(path: profile)
+ begin
+ profile_data = FastlaneCore::ProvisioningProfile.parse(profile)
+ UI.user_error!("Provisioning profile must belong to me.rxresu and team 654ASRW868") unless
+ profile_data["Entitlements"]["application-identifier"] == "654ASRW868.me.rxresu" &&
+ profile_data["TeamIdentifier"].include?("654ASRW868")
+ UI.user_error!("Use an App Store distribution profile") if
+ profile_data["ProvisionedDevices"] || profile_data["ProvisionsAllDevices"] ||
+ profile_data["Entitlements"]["get-task-allow"]
+ cocoapods(podfile: File.join(MOBILE, "ios/Podfile"))
+ update_code_signing_settings(
+ path: File.join(MOBILE, "ios/ReactiveResume.xcodeproj"),
+ use_automatic_signing: false, team_id: "654ASRW868", targets: ["ReactiveResume"],
+ build_configurations: ["Release"], code_sign_identity: "Apple Distribution",
+ profile_uuid: profile_data.fetch("UUID")
+ )
+ ENV["SOURCEMAP_FILE"] = File.join(OUTPUT, "main.jsbundle.map")
+ build_app(
+ workspace: File.join(MOBILE, "ios/ReactiveResume.xcworkspace"), scheme: "ReactiveResume",
+ configuration: "Release", export_method: "app-store",
+ output_directory: OUTPUT, output_name: "ReactiveResume.ipa",
+ archive_path: File.join(ENV.fetch("RUNNER_TEMP"), "ReactiveResume.xcarchive"),
+ buildlog_path: File.join(ENV.fetch("RUNNER_TEMP"), "mobile-build-logs"), xcodebuild_formatter: "",
+ export_options: {
+ signingStyle: "manual", teamID: "654ASRW868",
+ provisioningProfiles: { "me.rxresu" => profile_data.fetch("UUID") }
+ }
+ )
+ ensure
+ FileUtils.rm_f(installed)
+ end
+ end
+ ensure
+ delete_keychain(name: keychain)
+ end
+ end
+
+ desc "Upload to App Store Connect without review submission or external distribution"
+ lane :upload do
+ api_key = app_store_connect_api_key(
+ key_id: ENV.fetch("ASC_KEY_ID"), issuer_id: ENV.fetch("ASC_ISSUER_ID"),
+ key_content: ENV.fetch("ASC_PRIVATE_KEY")
+ )
+ upload_to_testflight(
+ api_key: api_key, app_identifier: "me.rxresu", apple_id: "6823975835",
+ ipa: File.join(OUTPUT, "ReactiveResume.ipa"),
+ skip_submission: true, skip_waiting_for_build_processing: true, distribute_external: false
+ )
+ end
+end
diff --git a/tooling/mobile/release.test.ts b/tooling/mobile/release.test.ts
new file mode 100644
index 000000000..4a73afe5a
--- /dev/null
+++ b/tooling/mobile/release.test.ts
@@ -0,0 +1,83 @@
+import { spawnSync } from "node:child_process";
+import { mkdtempSync, readFileSync, rmSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { fileURLToPath } from "node:url";
+import { expect, it } from "vite-plus/test";
+import { buildNumber, validateRelease } from "./release";
+
+const version = { MOBILE_BUILD_NUMBER_BASE: "100", GITHUB_RUN_NUMBER: "1", GITHUB_RUN_ATTEMPT: "1" };
+const android = {
+ ...version,
+ PLATFORM: "android",
+ UPLOAD: "false",
+ EXPO_TOKEN: "fixture",
+ ANDROID_KEYSTORE_BASE64: "fixture",
+ ANDROID_KEYSTORE_PASSWORD: "fixture",
+ ANDROID_KEY_ALIAS: "fixture",
+ ANDROID_KEY_PASSWORD: "fixture",
+};
+
+it("starts at the configured base and keeps versions unique across runs and retries", () => {
+ expect(buildNumber(version)).toBe(100);
+ expect(buildNumber({ ...version, GITHUB_RUN_ATTEMPT: "2" })).toBe(101);
+ expect(buildNumber({ ...version, GITHUB_RUN_ATTEMPT: "99" })).toBe(198);
+ expect(buildNumber({ ...version, GITHUB_RUN_NUMBER: "2" })).toBe(200);
+ expect(buildNumber({ ...version, MOBILE_BUILD_NUMBER_BASE: "2100000000" })).toBe(2_100_000_000);
+ expect(validateRelease(android)).toBe(100);
+});
+
+it.each([
+ { MOBILE_BUILD_NUMBER_BASE: "" },
+ { MOBILE_BUILD_NUMBER_BASE: "0" },
+ { MOBILE_BUILD_NUMBER_BASE: "-1" },
+ { MOBILE_BUILD_NUMBER_BASE: "1e3" },
+ { MOBILE_BUILD_NUMBER_BASE: "9007199254740992" },
+ { MOBILE_BUILD_NUMBER_BASE: "2100000001" },
+ { MOBILE_BUILD_NUMBER_BASE: "2099999901", GITHUB_RUN_NUMBER: "2" },
+ { GITHUB_RUN_NUMBER: "0" },
+ { GITHUB_RUN_ATTEMPT: "0" },
+ { GITHUB_RUN_ATTEMPT: "100" },
+])("rejects absent, ambiguous or overflowing version allocation: %j", (override) => {
+ expect(() => buildNumber({ ...version, ...override })).toThrow();
+});
+
+it("requires signing before build, and store credentials only when uploading", () => {
+ expect(() => validateRelease({ ...android, ANDROID_KEY_PASSWORD: "" })).toThrow("ANDROID_KEY_PASSWORD");
+ expect(() => validateRelease({ ...android, PLATFORM: "all" })).toThrow("IOS_DISTRIBUTION_P12_BASE64");
+ expect(() => validateRelease({ ...android, UPLOAD: "true" })).toThrow("GOOGLE_PLAY_SERVICE_ACCOUNT_JSON");
+ expect(validateRelease({ ...android, UPLOAD: "true", GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: "fixture" })).toBe(100);
+ const ios = {
+ ...version,
+ PLATFORM: "ios",
+ UPLOAD: "false",
+ EXPO_TOKEN: "fixture",
+ IOS_DISTRIBUTION_P12_BASE64: "fixture",
+ IOS_DISTRIBUTION_P12_PASSWORD: "fixture",
+ IOS_PROVISION_PROFILE_BASE64: "fixture",
+ };
+ expect(validateRelease(ios)).toBe(100);
+ expect(() => validateRelease({ ...ios, UPLOAD: "true" })).toThrow("ASC_KEY_ID, ASC_ISSUER_ID, ASC_PRIVATE_KEY");
+});
+
+it("CLI emits only validated version output and never echoes credential values on failure", () => {
+ const directory = mkdtempSync(join(tmpdir(), "mobile-release-"));
+ const script = fileURLToPath(new URL("./release.ts", import.meta.url));
+ const output = join(directory, "output");
+ try {
+ const env = { ...process.env, ...android, GITHUB_OUTPUT: output };
+ const valid = spawnSync(process.execPath, [script], { env, encoding: "utf8" });
+ expect(valid.status, valid.stderr).toBe(0);
+ expect(readFileSync(output, "utf8")).toBe("build_number=100\n");
+ const invalid = spawnSync(process.execPath, [script], {
+ env: { ...env, PLATFORM: "untrusted", ANDROID_KEYSTORE_PASSWORD: "private-fixture" },
+ encoding: "utf8",
+ });
+ expect(invalid.status).toBe(1);
+ expect(invalid.stderr).toContain("Invalid release platform");
+ expect(invalid.stderr).not.toContain("private-fixture");
+ expect(readFileSync(output, "utf8")).toBe("build_number=100\n");
+ } finally {
+ rmSync(directory, { recursive: true, force: true });
+ }
+});
diff --git a/tooling/mobile/release.ts b/tooling/mobile/release.ts
new file mode 100644
index 000000000..09d47474a
--- /dev/null
+++ b/tooling/mobile/release.ts
@@ -0,0 +1,50 @@
+import { appendFileSync } from "node:fs";
+import { resolve } from "node:path";
+import { pathToFileURL } from "node:url";
+
+// Reserve 99 attempts per workflow run; changing the offset later must never decrease store versions.
+export function buildNumber(env: NodeJS.ProcessEnv) {
+ const integer = (name: string) => {
+ const value = env[name];
+ if (!/^[0-9]+$/.test(value ?? "")) throw new Error(`${name} must be a non-negative integer`);
+ const number = Number(value);
+ if (!Number.isSafeInteger(number)) throw new Error(`${name} is too large`);
+ return number;
+ };
+ const base = integer("MOBILE_BUILD_NUMBER_BASE");
+ if (base < 1) throw new Error("MOBILE_BUILD_NUMBER_BASE must be positive");
+ const run = integer("GITHUB_RUN_NUMBER");
+ const attempt = integer("GITHUB_RUN_ATTEMPT");
+ if (run < 1 || attempt < 1 || attempt > 99) throw new Error("Run must be positive; attempt must be 1–99");
+ const number = base + (run - 1) * 100 + (attempt - 1);
+ if (!Number.isSafeInteger(number) || number > 2_100_000_000) throw new Error("Android versionCode limit exceeded");
+ return number;
+}
+
+export function validateRelease(env: NodeJS.ProcessEnv) {
+ if (!["all", "android", "ios"].includes(env.PLATFORM ?? "")) throw new Error("Invalid release platform");
+ if (!["true", "false"].includes(env.UPLOAD ?? "")) throw new Error("UPLOAD must be true or false");
+ const required = ["EXPO_TOKEN"];
+ if (env.PLATFORM !== "ios") {
+ required.push("ANDROID_KEYSTORE_BASE64", "ANDROID_KEYSTORE_PASSWORD", "ANDROID_KEY_ALIAS", "ANDROID_KEY_PASSWORD");
+ if (env.UPLOAD === "true") required.push("GOOGLE_PLAY_SERVICE_ACCOUNT_JSON");
+ }
+ if (env.PLATFORM !== "android") {
+ required.push("IOS_DISTRIBUTION_P12_BASE64", "IOS_DISTRIBUTION_P12_PASSWORD", "IOS_PROVISION_PROFILE_BASE64");
+ if (env.UPLOAD === "true") required.push("ASC_KEY_ID", "ASC_ISSUER_ID", "ASC_PRIVATE_KEY");
+ }
+ const missing = required.filter((name) => !env[name]?.trim());
+ if (missing.length) throw new Error(`Missing Actions secrets: ${missing.join(", ")}`);
+ return buildNumber(env);
+}
+
+if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
+ try {
+ const number = validateRelease(process.env);
+ if (!process.env.GITHUB_OUTPUT) throw new Error("GITHUB_OUTPUT is required");
+ appendFileSync(process.env.GITHUB_OUTPUT, `build_number=${number}\n`);
+ } catch (error) {
+ console.error(error instanceof Error ? error.message : "Mobile release preparation failed");
+ process.exitCode = 1;
+ }
+}
diff --git a/tooling/mobile/signing_test.rb b/tooling/mobile/signing_test.rb
new file mode 100644
index 000000000..0c424de11
--- /dev/null
+++ b/tooling/mobile/signing_test.rb
@@ -0,0 +1,23 @@
+require "minitest/autorun"
+require "fastlane"
+
+class SigningFilesTest < Minitest::Test
+ FASTFILE = Fastlane::FastFile.new(File.join(__dir__, "fastlane/Fastfile"))
+
+ def test_decodes_multiline_input_with_owner_only_permissions
+ Dir.mktmpdir do |directory|
+ path = FASTFILE.send(:secret_file, directory, "fixture.jks", "Zml4\ndHVyZQ==\n", base64: true)
+ assert_equal "fixture", File.binread(path)
+ assert_equal 0600, File.stat(path).mode & 0777
+ end
+ end
+
+ def test_invalid_encoding_leaves_no_file
+ Dir.mktmpdir do |directory|
+ assert_raises(ArgumentError) do
+ FASTFILE.send(:secret_file, directory, "fixture.p12", "invalid!", base64: true)
+ end
+ refute File.exist?(File.join(directory, "fixture.p12"))
+ end
+ end
+end