forked from pingdotgg/t3code
-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (144 loc) · 5.41 KB
/
Copy pathmobile-eas-development.yml
File metadata and controls
155 lines (144 loc) · 5.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Mobile EAS Development
# Keep the installable development client current without rebuilding it for
# JavaScript-only changes. Expo Fingerprint reuses a compatible native build
# and publishes an OTA update; native changes produce a new internal build.
# Free-plan build failures fall back to OTA against the latest finished binary.
on:
workflow_dispatch:
inputs:
platform:
description: "Target platform"
required: true
type: choice
default: ios
options:
- ios
- android
- all
runtime_version:
description: "Force OTA runtimeVersion (blank = fingerprint / fallback)"
required: false
type: string
sha:
description: "Exact release-branch SHA (blank uses that branch's current tip)"
required: false
type: string
release_branch:
description: "Release branch that must contain the SHA"
required: false
type: string
default: fork/integration
concurrency:
group: mobile-eas-development
cancel-in-progress: false
jobs:
development:
name: EAS Development
runs-on: ubuntu-24.04
permissions:
contents: read
env:
APP_VARIANT: development
NODE_OPTIONS: --max-old-space-size=8192
MOBILE_VERSION_POLICY: fingerprint
T3CODE_MOBILE_EAS_PROJECT_ID: ${{ vars.T3CODE_MOBILE_EAS_PROJECT_ID }}
T3CODE_MOBILE_EXPO_OWNER: ${{ vars.T3CODE_MOBILE_EXPO_OWNER }}
T3CODE_MOBILE_IOS_BUNDLE_IDENTIFIER: ${{ vars.T3CODE_MOBILE_IOS_BUNDLE_IDENTIFIER }}
T3CODE_MOBILE_IOS_TEAM_ID: ${{ vars.T3CODE_MOBILE_IOS_TEAM_ID }}
steps:
- id: expo-token
name: Check for EXPO_TOKEN
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: |
if [ -n "$EXPO_TOKEN" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "EXPO_TOKEN is not available; skipping EAS development job."
fi
- name: Checkout
if: steps.expo-token.outputs.present == 'true'
uses: actions/checkout@v6
with:
ref: ${{ inputs.release_branch }}
fetch-depth: 0
- name: Resolve approved integration source
if: steps.expo-token.outputs.present == 'true'
env:
REQUESTED_SHA: ${{ inputs.sha }}
run: |
integration_sha="$(git rev-parse HEAD)"
target_sha="${REQUESTED_SHA:-$integration_sha}"
if [[ ! "$target_sha" =~ ^[0-9a-f]{40}$ ]]; then
echo "sha must be an exact 40-character commit SHA" >&2
exit 1
fi
git fetch origin "$target_sha"
git merge-base --is-ancestor "$target_sha" "$integration_sha"
git checkout --detach "$target_sha"
test "$(git rev-parse HEAD)" = "$target_sha"
echo "sha=$target_sha" >> "$GITHUB_OUTPUT"
- name: Overlay deploy tooling from workflow ref
if: steps.expo-token.outputs.present == 'true' && github.ref_name != inputs.release_branch
env:
WORKFLOW_SHA: ${{ github.sha }}
run: |
git fetch origin "$WORKFLOW_SHA"
for path in \
apps/mobile/scripts/eas-continuous-deploy.sh \
apps/mobile/scripts/lib \
apps/mobile/app.config.ts \
.easignore; do
if git cat-file -e "${WORKFLOW_SHA}:${path}" 2>/dev/null; then
git checkout "$WORKFLOW_SHA" -- "$path"
echo "overlaid $path from $WORKFLOW_SHA"
fi
done
chmod +x apps/mobile/scripts/eas-continuous-deploy.sh
- name: Setup Vite+
if: steps.expo-token.outputs.present == 'true'
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Expose pnpm
if: steps.expo-token.outputs.present == 'true'
run: |
pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
"$vp_pnpm_bin/pnpm" --version
- name: Setup EAS
if: steps.expo-token.outputs.present == 'true'
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
packager: npm
- name: Pull development environment variables
if: steps.expo-token.outputs.present == 'true'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: eas env:pull development --non-interactive
- name: Publish compatible update or development build
if: steps.expo-token.outputs.present == 'true'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
GITHUB_SHA: ${{ github.sha }}
run: |
chmod +x scripts/eas-continuous-deploy.sh
args=(
--profile development
--channel development
--environment development
--platform "${{ inputs.platform }}"
--message "Development auto (${{ github.sha }})"
)
if [ -n "${{ inputs.runtime_version }}" ]; then
args+=(--runtime-version "${{ inputs.runtime_version }}")
fi
./scripts/eas-continuous-deploy.sh "${args[@]}"