Skip to content

Commit 17ad4bf

Browse files
feat(mobile): add v2 preview store build profile
1 parent b18a560 commit 17ad4bf

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ name: Mobile EAS Production
2424
# into the void.
2525
# workflow_dispatch remains as a manual override for both modes (e.g. to
2626
# retry an errored build or force an OTA).
27+
# Manual v2-preview builds keep the production app identity and disable OTA.
28+
# Select the v2 branch when dispatching a preview build.
2729
on:
2830
workflow_dispatch:
2931
inputs:
@@ -35,6 +37,14 @@ on:
3537
options:
3638
- build
3739
- update
40+
profile:
41+
description: "Store build profile (v2-preview supports build mode only)"
42+
required: true
43+
type: choice
44+
default: production
45+
options:
46+
- production
47+
- v2-preview
3848
platform:
3949
description: "Target platform"
4050
required: true
@@ -75,14 +85,20 @@ concurrency:
7585

7686
jobs:
7787
production:
78-
name: EAS Production ${{ github.event_name == 'push' && 'auto' || inputs.mode }}
88+
name: EAS ${{ inputs.profile || 'production' }} ${{ github.event_name == 'push' && 'auto' || inputs.mode }}
7989
runs-on: blacksmith-8vcpu-ubuntu-2404
8090
permissions:
8191
contents: read
8292
env:
8393
APP_VARIANT: production
8494
NODE_OPTIONS: --max-old-space-size=8192
8595
steps:
96+
- name: Reject preview OTA updates
97+
if: github.event_name == 'workflow_dispatch' && inputs.profile == 'v2-preview' && inputs.mode == 'update'
98+
run: |
99+
echo "::error::V2 previews use store builds only. Select mode=build."
100+
exit 1
101+
86102
- id: expo-token
87103
name: Check for EXPO_TOKEN
88104
env:
@@ -199,10 +215,12 @@ jobs:
199215
- name: Summarize manual build version
200216
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
201217
working-directory: apps/mobile
218+
env:
219+
MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
202220
run: |
203221
version="$(npx expo config --json --type public | jq -r '.version')"
204222
{
205-
echo "## Manual production build"
223+
echo "## Manual $MOBILE_BUILD_PROFILE build"
206224
echo
207225
echo "- App version: \`$version\`"
208226
echo "- Platform: \`${{ inputs.platform }}\`"
@@ -215,7 +233,8 @@ jobs:
215233
working-directory: apps/mobile
216234
env:
217235
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
218-
run: eas build --platform ${{ inputs.platform }} --profile production --auto-submit --non-interactive --no-wait
236+
MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
237+
run: eas build --platform ${{ inputs.platform }} --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait
219238

220239
- name: Publish OTA update (manual)
221240
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'

‎apps/mobile/eas.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
"buildType": "apk"
4141
}
4242
},
43+
"v2-preview": {
44+
"extends": "production",
45+
"distribution": "store",
46+
"channel": "v2-preview",
47+
"env": {
48+
"T3CODE_MOBILE_UPDATES_ENABLED": "0"
49+
}
50+
},
4351
"production": {
4452
"corepack": true,
4553
"env": {
@@ -52,6 +60,13 @@
5260
}
5361
},
5462
"submit": {
63+
"v2-preview": {
64+
"extends": "production",
65+
"android": {
66+
"track": "alpha",
67+
"releaseStatus": "completed"
68+
}
69+
},
5570
"production": {
5671
"ios": {
5772
"ascAppId": "6787819824"

0 commit comments

Comments
 (0)