-
Notifications
You must be signed in to change notification settings - Fork 2
192 lines (173 loc) · 6.02 KB
/
Copy pathmobile.yml
File metadata and controls
192 lines (173 loc) · 6.02 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Mobile Builds (EAS)
on:
push:
branches: [master]
tags:
- 'v*'
workflow_dispatch:
inputs:
platform:
description: 'Build platform'
required: true
default: 'all'
type: choice
options:
- all
- ios
- android
profile:
description: 'Build profile'
required: true
default: 'preview'
type: choice
options:
- development
- preview
- production
submit:
description: 'Auto-submit to stores'
required: false
default: false
type: boolean
workflow_call:
jobs:
build-ios:
name: Build iOS
runs-on: ubuntu-latest
if: ${{ !inputs.platform || inputs.platform == 'all' || inputs.platform == 'ios' }}
timeout-minutes: 60
defaults:
run:
working-directory: mobile
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v4
- run: pnpm install --ignore-workspace
- name: Patch expo-modules-core for Node compat
run: bash scripts/patch-expo-modules-core.sh
- name: Check EXPO_TOKEN
id: check
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "⚠ EXPO_TOKEN not set — skipping build"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup EAS
if: steps.check.outputs.skip != 'true'
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Build iOS
if: steps.check.outputs.skip != 'true'
run: |
PROFILE="${{ inputs.profile || 'preview' }}"
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
PROFILE="production"
fi
echo "Building iOS with profile: $PROFILE"
eas build --platform ios --profile $PROFILE --non-interactive
- name: Submit to TestFlight
if: steps.check.outputs.skip != 'true' && (inputs.submit || startsWith(github.ref, 'refs/tags/v'))
run: eas submit --platform ios --latest --non-interactive
continue-on-error: true
build-android:
name: Build Android
runs-on: ubuntu-latest
if: ${{ !inputs.platform || inputs.platform == 'all' || inputs.platform == 'android' }}
timeout-minutes: 60
defaults:
run:
working-directory: mobile
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v4
- run: pnpm install --ignore-workspace
- name: Patch expo-modules-core for Node compat
run: bash scripts/patch-expo-modules-core.sh
- name: Check EXPO_TOKEN
id: check
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "⚠ EXPO_TOKEN not set — skipping build"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup EAS
if: steps.check.outputs.skip != 'true'
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Build Android
if: steps.check.outputs.skip != 'true'
run: |
PROFILE="${{ inputs.profile || 'preview' }}"
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
PROFILE="production"
fi
echo "Building Android with profile: $PROFILE"
eas build --platform android --profile $PROFILE --non-interactive
- name: Submit to Google Play
if: steps.check.outputs.skip != 'true' && (inputs.submit || startsWith(github.ref, 'refs/tags/v'))
run: eas submit --platform android --latest --non-interactive
continue-on-error: true
publish-mobile-release:
name: Publish Mobile Release
runs-on: ubuntu-latest
needs: [build-ios, build-android]
if: always() && (needs.build-ios.result == 'success' || needs.build-android.result == 'success')
defaults:
run:
working-directory: mobile
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v4
- run: pnpm install --ignore-workspace
- name: Patch expo-modules-core for Node compat
run: bash scripts/patch-expo-modules-core.sh
- name: Check EXPO_TOKEN
id: check
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup EAS
if: steps.check.outputs.skip != 'true'
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Push OTA Update
if: steps.check.outputs.skip != 'true'
run: |
VERSION=$(node -p "require('../package.json').version")
eas update --branch preview --message "v${VERSION}" --non-interactive
continue-on-error: true
- name: Get build URLs
if: steps.check.outputs.skip != 'true'
id: builds
run: |
echo "## 📱 Mobile Builds" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Builds are available on [Expo Dashboard](https://expo.dev/accounts/profullstack/projects/smshub/builds)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **iOS:** Install via TestFlight (once Apple review completes)" >> $GITHUB_STEP_SUMMARY
echo "- **Android:** Download APK from Expo dashboard or install via internal distribution" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### OTA Update" >> $GITHUB_STEP_SUMMARY
echo "Existing installs will receive an over-the-air update automatically." >> $GITHUB_STEP_SUMMARY