Open History to see the last commit
1name: Mobile EAS Production
2
3# Production builds and OTA updates run from CI (Linux) — never from a laptop.
4# Under the fingerprint runtime-version policy the fingerprint must be computed
5# in the same OS/pnpm as the EAS build; a macOS `eas build` computes a different
6# fingerprint (platform-specific deps + pnpm version) and errors. On this Linux
7# runner, with corepack pinning pnpm 10.24 in eas.json, local == build.
8on:
9 workflow_dispatch:
10 inputs:
11 mode:
12 description: "build (+ auto-submit to TestFlight) or update (OTA)"
13 required: true
14 type: choice
15 default: build
16 options:
17 - build
18 - update
19 platform:
20 description: "Target platform"
21 required: true
22 type: choice
23 default: ios
24 options:
25 - ios
26 - android
27 - all
28 message:
29 description: "OTA update message (mode=update only)"
30 required: false
31 type: string
32
33jobs:
34 production:
35 name: EAS Production ${{ inputs.mode }}
36 runs-on: blacksmith-8vcpu-ubuntu-2404
37 permissions:
38 contents: read
39 env:
40 APP_VARIANT: production
41 NODE_OPTIONS: --max-old-space-size=8192
42 steps:
43 - id: expo-token
44 name: Check for EXPO_TOKEN
45 env:
46 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
47 run: |
48 if [ -n "$EXPO_TOKEN" ]; then
49 echo "present=true" >> "$GITHUB_OUTPUT"
50 else
51 echo "present=false" >> "$GITHUB_OUTPUT"
52 echo "EXPO_TOKEN is not available; skipping EAS production job."
53 fi
54
55 - name: Checkout
56 if: steps.expo-token.outputs.present == 'true'
57 uses: actions/checkout@v6
58 with:
59 fetch-depth: 0
60 # No sparse-checkout here: it makes actions/checkout fetch with
61 # --filter=blob:none, and eas-cli archives the project via
62 # `git clone --depth 1 file://<workspace>`, which fails (exit 128)
63 # when the partial clone can't serve the unfetched blobs.
64
65 - name: Setup Vite+
66 if: steps.expo-token.outputs.present == 'true'
67 uses: voidzero-dev/setup-vp@v1
68 with:
69 node-version-file: package.json
70 cache: true
71 run-install: |
72 args:
73 - --filter=@t3tools/mobile...
74
75 - name: Expose pnpm
76 if: steps.expo-token.outputs.present == 'true'
77 run: |
78 pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
79 vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
80 echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
81 "$vp_pnpm_bin/pnpm" --version
82
83 - name: Setup EAS
84 if: steps.expo-token.outputs.present == 'true'
85 uses: expo/expo-github-action@v8
86 with:
87 eas-version: latest
88 token: ${{ secrets.EXPO_TOKEN }}
89 # npm, not pnpm: this only installs eas-cli into the action's own
90 # tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
91 # ignored build script (no allowBuilds config outside the repo).
92 packager: npm
93
94 - name: Pull production environment variables
95 if: steps.expo-token.outputs.present == 'true'
96 working-directory: apps/mobile
97 env:
98 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
99 run: eas env:pull production --non-interactive
100
101 - name: Build and submit
102 if: steps.expo-token.outputs.present == 'true' && inputs.mode == 'build'
103 working-directory: apps/mobile
104 env:
105 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
106 run: eas build --platform ${{ inputs.platform }} --profile production --auto-submit --non-interactive --no-wait
107
108 - name: Publish OTA update
109 if: steps.expo-token.outputs.present == 'true' && inputs.mode == 'update'
110 working-directory: apps/mobile
111 env:
112 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
113 run: |
114 eas update \
115 --channel production \
116 --environment production \
117 --platform ${{ inputs.platform }} \
118 --message "${{ inputs.message || format('Production OTA ({0})', github.sha) }}" \
119 --non-interactive