Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

mobile-eas-preview.yml

94 lines3.3 KB

1name: Mobile EAS Preview
2​
3on:
4 pull_request:
5 types: [opened, reopened, synchronize, labeled]
6​
7jobs:
8 preview:
9 name: EAS Preview
10 if: |
11 contains(github.event.pull_request.labels.*.name, 'πŸš€ Mobile Continuous Deployment') &&
12 (github.event.action != 'labeled' || github.event.label.name == 'πŸš€ Mobile Continuous Deployment')
13 runs-on: blacksmith-8vcpu-ubuntu-2404
14 concurrency:
15 group: mobile-eas-preview-${{ github.event.pull_request.number }}
16 cancel-in-progress: true
17 permissions:
18 contents: read
19 pull-requests: write
20 env:
21 APP_VARIANT: preview
22 NODE_OPTIONS: --max-old-space-size=8192
23 MOBILE_VERSION_POLICY: fingerprint
24 steps:
25 - id: expo-token
26 name: Check for EXPO_TOKEN
27 env:
28 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
29 run: |
30 if [ -n "$EXPO_TOKEN" ]; then
31 echo "present=true" >> "$GITHUB_OUTPUT"
32 else
33 echo "present=false" >> "$GITHUB_OUTPUT"
34 echo "EXPO_TOKEN is not available; skipping EAS preview."
35 fi
36​
37 - name: Checkout
38 if: steps.expo-token.outputs.present == 'true'
39 uses: actions/checkout@v6
40 with:
41 fetch-depth: 0
42 # No sparse-checkout here: it makes actions/checkout fetch with
43 # --filter=blob:none, and eas-cli archives the project via
44 # `git clone --depth 1 file://<workspace>`, which fails (exit 128)
45 # when the partial clone can't serve the unfetched blobs.
46​
47 - name: Setup Vite+
48 if: steps.expo-token.outputs.present == 'true'
49 uses: voidzero-dev/setup-vp@v1
50 with:
51 node-version-file: package.json
52 cache: true
53 run-install: |
54 args:
55 - --filter=@t3tools/mobile...
56​
57 - name: Expose pnpm
58 if: steps.expo-token.outputs.present == 'true'
59 run: |
60 pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
61 vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
62 echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
63 "$vp_pnpm_bin/pnpm" --version
64​
65 - name: Setup EAS
66 if: steps.expo-token.outputs.present == 'true'
67 uses: expo/expo-github-action@v8
68 with:
69 eas-version: latest
70 token: ${{ secrets.EXPO_TOKEN }}
71 # npm, not pnpm: this only installs eas-cli into the action's own
72 # tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
73 # ignored build script (no allowBuilds config outside the repo).
74 packager: npm
75​
76 - name: Pull preview environment variables
77 if: steps.expo-token.outputs.present == 'true'
78 working-directory: apps/mobile
79 env:
80 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
81 run: eas env:pull preview --non-interactive
82​
83 - name: Deploy with fingerprint check
84 if: steps.expo-token.outputs.present == 'true'
85 uses: expo/expo-github-action/continuous-deploy-fingerprint@main
86 env:
87 EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
88 with:
89 profile: preview:dev
90 branch: pr-${{ github.event.pull_request.number }}
91 platform: all
92 environment: preview
93 working-directory: apps/mobile
94 github-token: ${{ secrets.GITHUB_TOKEN }}