The best way to control Claude Code, Codex and more from any computer or phone
ci(mobile): build Android store releases on Blacksmith (#33565)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Nov 9, 2026 at 15:34 UTC
9110dc2c932cb3bc57dc2845b9f1ea362f248796
2 files changed
+435
-11
.github/workflows/mobile-eas-production.yml
+430
-10
@@ -7,6 +7,12 @@ name: Mobile EAS Production
7
# runner, with corepack pinning pnpm 10.24 in eas.json, local == build.
8
#
9
# Every merge reconciles native fingerprints and publishes matching OTAs.
10
+# Android store builds run here with `eas build --local` on Blacksmith (the
11
+# android job). iOS builds run on EAS unless the MOBILE_IOS_LOCAL_BUILDS
12
+# repository variable is `true`, which moves them to the ios job the same way.
13
+# Local builds never appear in `eas build:list`, so each finished local build
14
+# pushes a mobile-android-build/<version>/<fingerprint> or
15
+# mobile-ios-build/<profile>/<version>/<fingerprint> tag that the reconcile reads.
16
# iOS prereleases use the testflight profile (3.0.0); App Store binaries use
17
# production and the committed app version, built manually. Both receive OTAs
18
# for their own major version. Android continues using production automatically.
@@ -65,20 +71,29 @@ on:
71
- pnpm-workspace.yaml
72
- .github/workflows/mobile-eas-production.yml
73
68
-# Serialize runs so OTAs publish in merge order. GitHub keeps at most one
69
-# queued run per group, so a burst of merges collapses into one run of the
70
-# newest commit — intermediate commits don't need their own OTA.
71
-concurrency:
72
- group: mobile-eas-production
73
- cancel-in-progress: false
74
-
74
jobs:
75
production:
76
name: EAS ${{ inputs.profile || 'production' }} ${{ github.event_name == 'push' && 'auto' || inputs.mode }}
77
if: github.repository == 'pingdotgg/t3code'
78
runs-on: blacksmith-8vcpu-ubuntu-2404
79
+ # Serialize runs so OTAs publish in merge order. GitHub keeps at most one
80
+ # queued job per group, so a burst of merges collapses into one run of the
81
+ # newest commit — intermediate commits don't need their own OTA.
82
+ concurrency:
83
+ group: mobile-eas-production
84
+ cancel-in-progress: false
85
permissions:
86
contents: read
87
+ outputs:
88
+ android_build: ${{ steps.reconcile.outputs.android_build || steps.android_manual.outputs.android_build }}
89
+ android_fingerprint: ${{ steps.reconcile.outputs.android_fingerprint || steps.android_manual.outputs.android_fingerprint }}
90
+ android_version: ${{ steps.reconcile.outputs.android_version || steps.android_manual.outputs.android_version }}
91
+ android_sha: ${{ steps.reconcile.outputs.android_sha || steps.android_manual.outputs.android_sha }}
92
+ ios_build: ${{ steps.reconcile.outputs.ios_build || steps.ios_manual.outputs.ios_build }}
93
+ ios_profile: ${{ steps.reconcile.outputs.ios_profile || steps.ios_manual.outputs.ios_profile }}
94
+ ios_fingerprint: ${{ steps.reconcile.outputs.ios_fingerprint || steps.ios_manual.outputs.ios_fingerprint }}
95
+ ios_version: ${{ steps.reconcile.outputs.ios_version || steps.ios_manual.outputs.ios_version }}
96
+ ios_sha: ${{ steps.reconcile.outputs.ios_sha || steps.ios_manual.outputs.ios_sha }}
97
env:
98
APP_VARIANT: production
99
NODE_OPTIONS: --max-old-space-size=8192
@@ -240,13 +255,51 @@ jobs:
255
echo "> Apple closes an iOS release train after App Store approval. Before building iOS, confirm \`$version\` is newer than the approved App Store version."
256
} >> "$GITHUB_STEP_SUMMARY"
257
243
- - name: Build and submit (manual)
244
- if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
258
+ - name: Build and submit iOS (manual)
259
+ if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build' && inputs.platform != 'android' && vars.MOBILE_IOS_LOCAL_BUILDS != 'true'
260
+ working-directory: apps/mobile
261
+ env:
262
+ EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
263
+ MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
264
+ run: eas build --platform ios --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait
265
+
266
+ - id: ios_manual
267
+ name: Queue iOS build (manual)
268
+ if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build' && inputs.platform != 'android' && vars.MOBILE_IOS_LOCAL_BUILDS == 'true'
269
working-directory: apps/mobile
270
env:
271
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
272
MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
249
- run: eas build --platform ${{ inputs.platform }} --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait
273
+ run: |
274
+ if [ "$MOBILE_BUILD_PROFILE" = "testflight" ]; then
275
+ T3CODE_MOBILE_VERSION="$(node -p 'require("./eas.json").build.testflight.env.T3CODE_MOBILE_VERSION')"
276
+ export T3CODE_MOBILE_VERSION
277
+ fi
278
+ version="$(npx expo config --json --type public | jq -r '.version')"
279
+ hash="$(eas fingerprint:generate --platform ios --environment production --json --non-interactive | sed -n '/^{/,$p' | jq -er '.hash | select(type == "string" and length > 0)')"
280
+ {
281
+ echo "ios_build=true"
282
+ echo "ios_profile=$MOBILE_BUILD_PROFILE"
283
+ echo "ios_fingerprint=$hash"
284
+ echo "ios_version=$version"
285
+ echo "ios_sha=$(git rev-parse HEAD)"
286
+ } >> "$GITHUB_OUTPUT"
287
+
288
+ - id: android_manual
289
+ name: Queue Android build (manual)
290
+ if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build' && inputs.platform != 'ios'
291
+ working-directory: apps/mobile
292
+ env:
293
+ EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
294
+ run: |
295
+ version="$(npx expo config --json --type public | jq -r '.version')"
296
+ hash="$(eas fingerprint:generate --platform android --environment production --json --non-interactive | sed -n '/^{/,$p' | jq -er '.hash | select(type == "string" and length > 0)')"
297
+ {
298
+ echo "android_build=true"
299
+ echo "android_fingerprint=$hash"
300
+ echo "android_version=$version"
301
+ echo "android_sha=$(git rev-parse HEAD)"
302
+ } >> "$GITHUB_OUTPUT"
303
304
# @expo/fingerprint swallows autolinking errors and returns no Expo module
305
# sources, so native changes stop moving the hash and OTAs reach binaries
@@ -300,6 +353,7 @@ jobs:
353
working-directory: apps/mobile
354
env:
355
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
356
+ IOS_LOCAL_BUILDS: ${{ vars.MOBILE_IOS_LOCAL_BUILDS == 'true' }}
357
run: |
358
failed=0
359
message="$(git log -1 --pretty=%s | head -c 120) ($(git rev-parse --short=9 HEAD))"
@@ -320,6 +374,22 @@ jobs:
374
active="$(jq '[.[] | select(.status == "NEW" or .status == "IN_QUEUE" or .status == "IN_PROGRESS")] | length' <<<"$matches")"
375
errored="$(jq '[.[] | select(.status == "ERRORED")] | length' <<<"$matches")"
376
latest_version="$(eas build:list --platform "$platform" --build-profile "$profile" --limit 1 --json --non-interactive | jq -r '.[0].appVersion // "none"')"
377
+ # Local builds (the android and ios jobs) record each build as a tag;
378
+ # EAS records still count for builds made before that.
379
+ tag_prefix=""
380
+ if [ "$platform" = "android" ]; then
381
+ tag_prefix="mobile-android-build"
382
+ elif [ "$IOS_LOCAL_BUILDS" = "true" ]; then
383
+ tag_prefix="mobile-ios-build/$profile"
384
+ fi
385
+ if [ -n "$tag_prefix" ]; then
386
+ if [ -n "$(git tag -l "$tag_prefix/*/$hash")" ]; then
387
+ finished=$((finished + 1))
388
+ fi
389
+ if [ -n "$(git tag -l "$tag_prefix/$version/*")" ]; then
390
+ latest_version="$version"
391
+ fi
392
+ fi
393
394
if [ "$finished" -gt 0 ]; then
395
if eas update \
@@ -363,6 +433,27 @@ jobs:
433
fi
434
435
echo "$platform: $reason — building"
436
+ if [ "$platform" = "android" ]; then
437
+ {
438
+ echo "android_build=true"
439
+ echo "android_fingerprint=$hash"
440
+ echo "android_version=$version"
441
+ echo "android_sha=$(git rev-parse HEAD)"
442
+ } >> "$GITHUB_OUTPUT"
443
+ echo ":building_construction: android: building and submitting $version in the Android store build job ($reason)" >> "$GITHUB_STEP_SUMMARY"
444
+ continue
445
+ fi
446
+ if [ "$platform" = "ios" ] && [ "$IOS_LOCAL_BUILDS" = "true" ]; then
447
+ {
448
+ echo "ios_build=true"
449
+ echo "ios_profile=$profile"
450
+ echo "ios_fingerprint=$hash"
451
+ echo "ios_version=$version"
452
+ echo "ios_sha=$(git rev-parse HEAD)"
453
+ } >> "$GITHUB_OUTPUT"
454
+ echo ":building_construction: ios/$profile: building and submitting $version in the iOS store build job ($reason)" >> "$GITHUB_STEP_SUMMARY"
455
+ continue
456
+ fi
457
if eas build --platform "$platform" --profile "$profile" --auto-submit --non-interactive --no-wait; then
458
echo ":building_construction: $platform: scheduled production build and submission for $version ($reason)" >> "$GITHUB_STEP_SUMMARY"
459
else
@@ -386,3 +477,332 @@ jobs:
477
node scripts/upload-sourcemaps.mts ota "$dir"
478
fi
479
done
480
+
481
+ # `eas build --local` on Blacksmith, ARM-only, without release lint (see the
482
+ # production profile in eas.json), with Gradle, ccache, and pnpm state on a
483
+ # sticky disk. Its own concurrency group keeps later OTAs from waiting on it.
484
+ android:
485
+ name: Android store build
486
+ needs: production
487
+ # Skipped when the production job failed: no store build after a failed OTA.
488
+ if: needs.production.outputs.android_build == 'true'
489
+ runs-on: blacksmith-32vcpu-ubuntu-2404
490
+ timeout-minutes: 60
491
+ concurrency:
492
+ group: mobile-android-store-build
493
+ cancel-in-progress: false
494
+ permissions:
495
+ contents: write # pushes the build record tag
496
+ env:
497
+ APP_VARIANT: production
498
+ NODE_OPTIONS: --max-old-space-size=8192
499
+ EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
500
+ BUILD_TAG: mobile-android-build/${{ needs.production.outputs.android_version }}/${{ needs.production.outputs.android_fingerprint }}
501
+ steps:
502
+ - name: Checkout
503
+ uses: actions/checkout@v6
504
+ with:
505
+ ref: ${{ needs.production.outputs.android_sha }}
506
+ fetch-depth: 0
507
+ # Dependency scripts and the build run in this job; only Record build gets a token.
508
+ persist-credentials: false
509
+
510
+ # A queued run can follow a build of the same fingerprint; manual runs always build.
511
+ - id: record
512
+ name: Check build record
513
+ env:
514
+ FORCE: ${{ github.event_name == 'workflow_dispatch' }}
515
+ run: |
516
+ if [ "$FORCE" != "true" ] && [ -n "$(git tag -l "$BUILD_TAG")" ]; then
517
+ echo "built=true" >> "$GITHUB_OUTPUT"
518
+ echo ":white_check_mark: android: \`$BUILD_TAG\` was built by an earlier run" >> "$GITHUB_STEP_SUMMARY"
519
+ fi
520
+
521
+ - name: Prepare build directories
522
+ if: steps.record.outputs.built != 'true'
523
+ run: |
524
+ cache="$HOME/.cache/t3-android-store"
525
+ {
526
+ echo "GRADLE_USER_HOME=$cache/gradle"
527
+ echo "CCACHE_DIR=$cache/ccache"
528
+ echo "CCACHE_MAXSIZE=5G"
529
+ # Gradle installs the NDK fresh each run, so key on the compiler's version, not its mtime.
530
+ echo "CCACHE_COMPILERCHECK=%compiler% -v"
531
+ echo "pnpm_config_store_dir=$cache/pnpm-store"
532
+ # eas build --local copies the project here. A fixed path keeps
533
+ # ccache keys stable, and the same disk as the store lets pnpm hardlink.
534
+ echo "EAS_LOCAL_BUILD_WORKINGDIR=$cache/eas-build"
535
+ echo "CCACHE_BASEDIR=$cache/eas-build"
536
+ # CMake (3.17+) reads these, and AGP passes Gradle's environment through.
537
+ echo "CMAKE_C_COMPILER_LAUNCHER=ccache"
538
+ echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache"
539
+ } >> "$GITHUB_ENV"
540
+
541
+ - name: Mount build cache
542
+ if: steps.record.outputs.built != 'true'
543
+ uses: useblacksmith/stickydisk@v1
544
+ with:
545
+ key: ${{ github.repository }}-android-store-build
546
+ path: ~/.cache/t3-android-store
547
+
548
+ - name: Configure Gradle and ccache
549
+ if: steps.record.outputs.built != 'true'
550
+ run: |
551
+ mkdir -p "$GRADLE_USER_HOME" "$CCACHE_DIR"
552
+ rm -rf "$EAS_LOCAL_BUILD_WORKINGDIR"
553
+ # No daemon: nothing should hold the sticky disk open when it is committed.
554
+ printf 'org.gradle.caching=true\norg.gradle.daemon=false\n' > "$GRADLE_USER_HOME/gradle.properties"
555
+ sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
556
+ sudo apt-get update -qq && sudo apt-get install -y -qq ccache
557
+ ccache --zero-stats
558
+
559
+ - name: Setup Node
560
+ if: steps.record.outputs.built != 'true'
561
+ uses: actions/setup-node@v6
562
+ with:
563
+ node-version-file: package.json
564
+
565
+ - name: Enable corepack
566
+ if: steps.record.outputs.built != 'true'
567
+ run: |
568
+ npm install --global corepack@latest
569
+ corepack enable
570
+ pnpm --version
571
+
572
+ # EAS commands load app.config.ts, whose plugins must resolve. Keep install
573
+ # scripts: some download native assets that the build's fingerprint check hashes.
574
+ - name: Install mobile dependencies
575
+ if: steps.record.outputs.built != 'true'
576
+ run: pnpm install --frozen-lockfile --prefer-offline --filter=@t3tools/mobile...
577
+
578
+ - name: Setup Java
579
+ if: steps.record.outputs.built != 'true'
580
+ uses: actions/setup-java@v5
581
+ with:
582
+ distribution: temurin
583
+ java-version: 17
584
+
585
+ - name: Setup EAS
586
+ if: steps.record.outputs.built != 'true'
587
+ uses: expo/expo-github-action@v8
588
+ with:
589
+ eas-version: latest
590
+ token: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
591
+ packager: npm
592
+
593
+ - name: Pull production environment variables
594
+ if: steps.record.outputs.built != 'true'
595
+ working-directory: apps/mobile
596
+ run: |
597
+ eas env:pull production --non-interactive
598
+ node --input-type=module <<'NODE'
599
+ import { appendFileSync, readFileSync } from "node:fs";
600
+ import { parseEnv } from "node:util";
601
+ const env = parseEnv(readFileSync(".env.local", "utf8"));
602
+ const googleServicesFile = env.T3CODE_ANDROID_GOOGLE_SERVICES_FILE;
603
+ if (!googleServicesFile) {
604
+ throw new Error("T3CODE_ANDROID_GOOGLE_SERVICES_FILE is missing from the production environment");
605
+ }
606
+ appendFileSync(process.env.GITHUB_ENV, `T3CODE_ANDROID_GOOGLE_SERVICES_FILE=${googleServicesFile}\n`);
607
+ NODE
608
+
609
+ - name: Build
610
+ if: steps.record.outputs.built != 'true'
611
+ working-directory: apps/mobile
612
+ env:
613
+ # EAS secret variables don't reach local builds; the eas-build-on-success
614
+ # hook needs these to upload the bundle's source map.
615
+ MOBILE_SOURCEMAPS_R2: ${{ secrets.MOBILE_SOURCEMAPS_R2 }}
616
+ run: |
617
+ eas build --local --platform android --profile production --non-interactive --output "$RUNNER_TEMP/t3code.aab"
618
+ abis="$(unzip -Z1 "$RUNNER_TEMP/t3code.aab" | sed -n 's|^base/lib/\([^/]*\)/.*|\1|p' | sort -u | paste -sd, -)"
619
+ {
620
+ echo "### Android $BUILD_TAG"
621
+ echo "- ABIs: \`$abis\`"
622
+ echo '```'
623
+ ccache --show-stats
624
+ echo '```'
625
+ } >> "$GITHUB_STEP_SUMMARY"
626
+ if [ "$abis" != "arm64-v8a,armeabi-v7a" ]; then
627
+ echo "::error::Expected only ARM native libraries in the AAB, found $abis"
628
+ exit 1
629
+ fi
630
+
631
+ - name: Submit to Google Play
632
+ if: steps.record.outputs.built != 'true'
633
+ working-directory: apps/mobile
634
+ run: eas submit --platform android --profile production --path "$RUNNER_TEMP/t3code.aab" --non-interactive
635
+
636
+ # The tag means "delivered", so it follows the submit. If it can't be
637
+ # pushed, the next merge rebuilds with a new build number; nothing is lost.
638
+ - name: Record build
639
+ if: steps.record.outputs.built != 'true'
640
+ env:
641
+ GH_TOKEN: ${{ github.token }}
642
+ run: |
643
+ sha="$(git rev-parse HEAD)"
644
+ # GitHub occasionally fails ref writes server-side ("fatal error in commit_refs").
645
+ for attempt in 1 2 3; do
646
+ if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$BUILD_TAG" >/dev/null 2>&1; then
647
+ echo "$BUILD_TAG exists."
648
+ break
649
+ fi
650
+ if gh api "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/tags/$BUILD_TAG" -f sha="$sha" >/dev/null; then
651
+ break
652
+ fi
653
+ if [ "$attempt" = 3 ]; then
654
+ echo "::error::Submitted, but could not create $BUILD_TAG; the next merge will rebuild."
655
+ exit 1
656
+ fi
657
+ sleep $((attempt * 15))
658
+ done
659
+ echo ":rocket: android: submitted and recorded \`$BUILD_TAG\`" >> "$GITHUB_STEP_SUMMARY"
660
+
661
+ # Off unless the MOBILE_IOS_LOCAL_BUILDS repository variable is `true`; the
662
+ # production job only sets ios_build then. Store binaries need the final
663
+ # Xcode 27.1; MOBILE_IOS_ALLOW_XCODE_RC=true accepts the release candidate.
664
+ # No sticky disk: it mounts ext4 and only works on Linux runners.
665
+ ios:
666
+ name: iOS store build
667
+ needs: production
668
+ # Skipped when the production job failed: no store build after a failed OTA.
669
+ if: needs.production.outputs.ios_build == 'true'
670
+ runs-on: blacksmith-12vcpu-macos-27
671
+ timeout-minutes: 60
672
+ concurrency:
673
+ group: mobile-ios-store-build
674
+ cancel-in-progress: false
675
+ permissions:
676
+ contents: write # pushes the build record tag
677
+ env:
678
+ APP_VARIANT: production
679
+ NODE_OPTIONS: --max-old-space-size=8192
680
+ EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
681
+ PROFILE: ${{ needs.production.outputs.ios_profile }}
682
+ BUILD_TAG: mobile-ios-build/${{ needs.production.outputs.ios_profile }}/${{ needs.production.outputs.ios_version }}/${{ needs.production.outputs.ios_fingerprint }}
683
+ ALLOW_XCODE_RC: ${{ vars.MOBILE_IOS_ALLOW_XCODE_RC == 'true' }}
684
+ steps:
685
+ - name: Checkout
686
+ uses: actions/checkout@v6
687
+ with:
688
+ ref: ${{ needs.production.outputs.ios_sha }}
689
+ fetch-depth: 0
690
+ # Dependency scripts and the build run in this job; only Record build gets a token.
691
+ persist-credentials: false
692
+
693
+ # A queued run can follow a build of the same fingerprint; manual runs always build.
694
+ - id: record
695
+ name: Check build record
696
+ env:
697
+ FORCE: ${{ github.event_name == 'workflow_dispatch' }}
698
+ run: |
699
+ if [ "$FORCE" != "true" ] && [ -n "$(git tag -l "$BUILD_TAG")" ]; then
700
+ echo "built=true" >> "$GITHUB_OUTPUT"
701
+ echo ":white_check_mark: ios: \`$BUILD_TAG\` was built by an earlier run" >> "$GITHUB_STEP_SUMMARY"
702
+ fi
703
+
704
+ - name: Select Xcode 27.1
705
+ if: steps.record.outputs.built != 'true'
706
+ run: |
707
+ xcode=/Applications/Xcode_27.1.app
708
+ if [ ! -d "$xcode" ] && [ "$ALLOW_XCODE_RC" = "true" ]; then
709
+ xcode=/Applications/Xcode_27.1_Release_Candidate.app
710
+ fi
711
+ if [ ! -d "$xcode" ]; then
712
+ ls -d /Applications/Xcode*.app
713
+ echo "::error::Xcode 27.1 (final) is not on this runner. Set the MOBILE_IOS_ALLOW_XCODE_RC repository variable to true to build store binaries with the release candidate."
714
+ exit 1
715
+ fi
716
+ sudo xcode-select -s "$xcode/Contents/Developer"
717
+ xcodebuild -version
718
+ echo "- Xcode: \`$(basename "$xcode")\`" >> "$GITHUB_STEP_SUMMARY"
719
+
720
+ # EAS's credentials step fails to import the distribution certificate without it.
721
+ - name: Install Apple WWDR G3 intermediate
722
+ if: steps.record.outputs.built != 'true'
723
+ run: |
724
+ curl -fsSL -o "$RUNNER_TEMP/AppleWWDRCAG3.cer" https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
725
+ sudo security add-certificates -k /Library/Keychains/System.keychain "$RUNNER_TEMP/AppleWWDRCAG3.cer" || true
726
+ security find-certificate -c "Apple Worldwide Developer Relations" /Library/Keychains/System.keychain | grep -m1 labl
727
+
728
+ - name: Setup Node
729
+ if: steps.record.outputs.built != 'true'
730
+ uses: actions/setup-node@v6
731
+ with:
732
+ node-version-file: package.json
733
+
734
+ - name: Enable corepack
735
+ if: steps.record.outputs.built != 'true'
736
+ run: |
737
+ npm install --global corepack@latest
738
+ corepack enable
739
+ pnpm --version
740
+
741
+ # EAS commands load app.config.ts, whose plugins must resolve. Keep install
742
+ # scripts: some download native assets that the build's fingerprint check hashes.
743
+ - name: Install mobile dependencies
744
+ if: steps.record.outputs.built != 'true'
745
+ run: pnpm install --frozen-lockfile --prefer-offline --filter=@t3tools/mobile...
746
+
747
+ - name: Setup EAS
748
+ if: steps.record.outputs.built != 'true'
749
+ uses: expo/expo-github-action@v8
750
+ with:
751
+ eas-version: latest
752
+ token: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
753
+ packager: npm
754
+
755
+ - name: Build tools
756
+ if: steps.record.outputs.built != 'true'
757
+ run: |
758
+ command -v pod || sudo gem install cocoapods --no-document
759
+ command -v fastlane || brew install fastlane
760
+ pod --version
761
+ fastlane --version | tail -1
762
+
763
+ - name: Pull production environment variables
764
+ if: steps.record.outputs.built != 'true'
765
+ working-directory: apps/mobile
766
+ run: eas env:pull production --non-interactive
767
+
768
+ - name: Build
769
+ if: steps.record.outputs.built != 'true'
770
+ working-directory: apps/mobile
771
+ env:
772
+ # EAS secret variables don't reach local builds; the eas-build-on-success
773
+ # hook needs these to upload the bundle's source map.
774
+ MOBILE_SOURCEMAPS_R2: ${{ secrets.MOBILE_SOURCEMAPS_R2 }}
775
+ run: |
776
+ # A real path: /var -> /private/var symlinks break the expo-widgets bundle step.
777
+ export EAS_LOCAL_BUILD_WORKINGDIR="$RUNNER_TEMP/eas-build"
778
+ eas build --local --platform ios --profile "$PROFILE" --non-interactive --output "$RUNNER_TEMP/t3code.ipa"
779
+
780
+ - name: Submit to App Store Connect
781
+ if: steps.record.outputs.built != 'true'
782
+ working-directory: apps/mobile
783
+ run: eas submit --platform ios --profile "$PROFILE" --path "$RUNNER_TEMP/t3code.ipa" --non-interactive
784
+
785
+ # The tag means "delivered", so it follows the submit. If it can't be
786
+ # pushed, the next merge rebuilds with a new build number; nothing is lost.
787
+ - name: Record build
788
+ if: steps.record.outputs.built != 'true'
789
+ env:
790
+ GH_TOKEN: ${{ github.token }}
791
+ run: |
792
+ sha="$(git rev-parse HEAD)"
793
+ # GitHub occasionally fails ref writes server-side ("fatal error in commit_refs").
794
+ for attempt in 1 2 3; do
795
+ if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$BUILD_TAG" >/dev/null 2>&1; then
796
+ echo "$BUILD_TAG exists."
797
+ break
798
+ fi
799
+ if gh api "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/tags/$BUILD_TAG" -f sha="$sha" >/dev/null; then
800
+ break
801
+ fi
802
+ if [ "$attempt" = 3 ]; then
803
+ echo "::error::Submitted, but could not create $BUILD_TAG; the next merge will rebuild."
804
+ exit 1
805
+ fi
806
+ sleep $((attempt * 15))
807
+ done
808
+ echo ":rocket: ios: submitted and recorded \`$BUILD_TAG\`" >> "$GITHUB_STEP_SUMMARY"
apps/mobile/eas.json
+5
-1
@@ -67,11 +67,15 @@
67
"env": {
68
"APP_VARIANT": "production",
69
"NODE_OPTIONS": "--max-old-space-size=4096",
70
- "SOURCEMAP_FILE": "/tmp/t3code-ios-main.jsbundle.map"
70
+ "SOURCEMAP_FILE": "/tmp/t3code-ios-main.jsbundle.map",
71
+ "ORG_GRADLE_PROJECT_reactNativeArchitectures": "armeabi-v7a,arm64-v8a"
72
},
73
"channel": "production",
74
"environment": "production",
75
"autoIncrement": true,
76
+ "android": {
77
+ "gradleCommand": ":app:bundleRelease -x lintVitalAnalyzeRelease -x lintVitalRelease"
78
+ },
79
"ios": {
80
"image": "macos-tahoe-26.6-xcode-27.1"
81
}