TypeScript
feat(mobile): add v2 preview store builds (#11966)
Julius Marmingee6ae764f47d6
diff --git a/.github/workflows/mobile-eas-production.yml b/.github/workflows/mobile-eas-production.ymlindex 4ad9f4f7672..227004b4882 100644--- a/.github/workflows/mobile-eas-production.yml+++ b/.github/workflows/mobile-eas-production.yml@@ -24,6 +24,8 @@ name: Mobile EAS Production# into the void.# workflow_dispatch remains as a manual override for both modes (e.g. to# retry an errored build or force an OTA).+# Manual v2-preview builds keep the production app identity and disable OTA.+# Select the v2 branch when dispatching a preview build.on:workflow_dispatch:inputs:@@ -35,6 +37,14 @@ on:options:- build- update+ profile:+ description: "Store build profile (v2-preview supports build mode only)"+ required: true+ type: choice+ default: production+ options:+ - production+ - v2-previewplatform:description: "Target platform"required: true@@ -75,7 +85,7 @@ concurrency:jobs:production:- name: EAS Production ${{ github.event_name == 'push' && 'auto' || inputs.mode }}+ name: EAS ${{ inputs.profile || 'production' }} ${{ github.event_name == 'push' && 'auto' || inputs.mode }}runs-on: blacksmith-8vcpu-ubuntu-2404permissions:contents: read@@ -83,6 +93,12 @@ jobs:APP_VARIANT: productionNODE_OPTIONS: --max-old-space-size=8192steps:+ - name: Reject preview OTA updates+ if: github.event_name == 'workflow_dispatch' && inputs.profile == 'v2-preview' && inputs.mode == 'update'+ run: |+ echo "::error::V2 previews use store builds only. Select mode=build."+ exit 1+- id: expo-tokenname: Check for EXPO_TOKENenv:@@ -125,6 +141,16 @@ jobs:args:- --filter=@t3tools/mobile...+ - name: Verify v2 preview source+ if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.profile == 'v2-preview'+ run: |+ node --input-type=module -e '+ import * as environment from "./packages/contracts/src/environment.ts";+ if (environment.ORCHESTRATION_PROTOCOL_VERSION !== 2) {+ throw new Error("V2 previews require a v2 source branch. Select the v2 branch when running this workflow.");+ }+ '+- name: Expose pnpmif: steps.expo-token.outputs.present == 'true'run: |@@ -199,10 +225,12 @@ jobs:- name: Summarize manual build versionif: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'working-directory: apps/mobile+ env:+ MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}run: |version="$(npx expo config --json --type public | jq -r '.version')"{- echo "## Manual production build"+ echo "## Manual $MOBILE_BUILD_PROFILE build"echoecho "- App version: \`$version\`"echo "- Platform: \`${{ inputs.platform }}\`"@@ -215,7 +243,8 @@ jobs:working-directory: apps/mobileenv:EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}- run: eas build --platform ${{ inputs.platform }} --profile production --auto-submit --non-interactive --no-wait+ MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}+ run: eas build --platform ${{ inputs.platform }} --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait- name: Publish OTA update (manual)if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'diff --git a/apps/mobile/eas.json b/apps/mobile/eas.jsonindex a1d315b7e14..77a2a6427e1 100644--- a/apps/mobile/eas.json+++ b/apps/mobile/eas.json@@ -40,6 +40,14 @@"buildType": "apk"}},+ "v2-preview": {+ "extends": "production",+ "distribution": "store",+ "channel": "v2-preview",+ "env": {+ "T3CODE_MOBILE_UPDATES_ENABLED": "0"+ }+ },"production": {"corepack": true,"env": {@@ -52,6 +60,13 @@}},"submit": {+ "v2-preview": {+ "extends": "production",+ "android": {+ "track": "alpha",+ "releaseStatus": "completed"+ }+ },"production": {"ios": {"ascAppId": "6787819824"