1
- name : 🚀 EAS Android Build & Smart Release
1
+ name : 🚠EAS Android Build & Smart Release
2
2
3
3
on :
4
4
push :
5
- branches : [main]
5
+ branches :
6
+ - main
6
7
workflow_dispatch :
7
8
8
9
env :
11
12
12
13
jobs :
13
14
build-android :
14
- name : 🔨 Build Android - Version Manager
15
+ name : 🔠Build Android - Version Manager
15
16
runs-on : ubuntu-latest
16
17
outputs :
17
18
build_id : ${{ steps.build.outputs.BUILD_ID }}
@@ -20,55 +21,46 @@ jobs:
20
21
build_date : ${{ steps.version-control.outputs.build_date }}
21
22
is_production : ${{ steps.version-control.outputs.is_production }}
22
23
steps :
23
- # ========================
24
- # 🛠️ Repository Setup
25
- # ========================
26
- - name : " 📦 Checkout (Full History)"
24
+ # Repository Setup
25
+ - name : " 📠Checkout (Full History)"
27
26
uses : actions/checkout@v4
28
27
with :
29
28
fetch-depth : 0
30
29
31
- # ========================
32
- # ⚙️ Environment Configuration
33
- # ========================
34
- - name : " 📦 Setup Node.js 20.x"
30
+ # Environment Configuration
31
+ - name : " 📠Setup Node.js 20.x"
35
32
uses : actions/setup-node@v4
36
33
with :
37
34
node-version : 20.x
38
- # NOTE: Removed cache: "pnpm" to avoid expecting pnpm pre-installed
39
35
40
- - name : " 🔧 Install pnpm"
36
+ - name : " 🔠Install pnpm"
41
37
run : |
42
38
npm install -g pnpm
43
39
pnpm --version
44
40
45
- - name : " 🧩 Install dependencies (ci)"
41
+ - name : " 🧠Install dependencies (ci)"
46
42
run : pnpm install --frozen-lockfile
47
43
48
- # ========================
49
- # 🔄 Version Management
50
- # ========================
51
- - name : " 🔄 Update Production Version"
44
+ # Version Management
45
+ - name : " 🔠Update Production Version"
52
46
if : github.ref == 'refs/heads/main'
53
47
run : node scripts/bumpVersion.js
54
48
55
- - name : " 🔧 Configure Git for Automation"
49
+ - name : " 🔠Configure Git for Automation"
56
50
if : github.ref == 'refs/heads/main'
57
51
run : |
58
52
git config --global user.name "GitHub Actions"
59
53
git config --global user.email "[email protected] "
60
54
61
- - name : " 💾 Commit Version Update"
55
+ - name : " 💠Commit Version Update"
62
56
if : github.ref == 'refs/heads/main'
63
57
run : |
64
58
git add version.json
65
59
git commit -m "chore: Auto-increment version [skip ci]"
66
60
git push
67
61
68
- # ========================
69
- # 📌 Version Tagging
70
- # ========================
71
- - name : " 🏷️ Set CI/CD Versions"
62
+ # Version Tagging
63
+ - name : " ðŸï¸ Set CI/CD Versions"
72
64
id : version-control
73
65
run : |
74
66
# Use version from version.json (requires jq)
95
87
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
96
88
echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV
97
89
98
- # ========================
99
- # 🔐 EAS Setup & Auth
100
- # ========================
101
- - name : " 🔧 Setup pnpm global bin"
90
+ # EAS Setup & Auth
91
+ - name : " 🔠Setup pnpm global bin"
102
92
env :
103
93
SHELL : /bin/bash
104
94
run : |
@@ -110,14 +100,12 @@ jobs:
110
100
- name : " âš™ï¸ Install EAS CLI"
111
101
run : pnpm add -g eas-cli@latest
112
102
113
- - name : " 🔐 Verify Expo Credentials"
103
+ - name : " 🔠Verify Expo Credentials"
114
104
run : eas whoami --token $EXPO_TOKEN
115
105
env :
116
106
EXPO_TOKEN : ${{ secrets.EXPO_TOKEN }}
117
107
118
- # ========================
119
- # Ensure consistent pnpm store: Force reinstallation of dependencies
120
- # ========================
108
+ # Force reinstallation of dependencies
121
109
- name : " Set pnpm global store directory"
122
110
run : pnpm config set store-dir "$HOME/.local/share/pnpm/store" --global
123
111
@@ -127,19 +115,23 @@ jobs:
127
115
- name : " Install @expo/config-plugins"
128
116
run : pnpm add @expo/config-plugins
129
117
130
- # ========================
131
118
# Install @babel/runtime to resolve bundling error
132
- # ========================
133
119
- name : " Install @babel/runtime"
134
120
run : pnpm add @babel/runtime
135
121
136
- # ========================
137
- # 🏗️ Build Execution
138
- # ========================
139
- - name : " 🚀 Trigger EAS Build"
122
+ # Debug Dependency Tree
123
+ - name : " 🔠Debug Dependency Tree"
124
+ run : |
125
+ echo "Listing installed dependencies..."
126
+ pnpm list --depth=0
127
+ echo "Checking for expo-constants..."
128
+ ls node_modules/expo-constants || echo "expo-constants not found!"
129
+
130
+ # Build Execution
131
+ - name : " 🚠Trigger EAS Build"
140
132
id : build
141
133
run : |
142
- echo "🔄 Initializing build process..."
134
+ echo "🔠Initializing build process..."
143
135
sudo apt-get install -y jq
144
136
BUILD_JSON=$(eas build -p android --profile production --non-interactive --json)
145
137
echo "Raw build output: $BUILD_JSON"
@@ -155,50 +147,43 @@ jobs:
155
147
EXPO_TOKEN : ${{ secrets.EXPO_TOKEN }}
156
148
157
149
download-apk :
158
- name : " 📥 APK Artifact Handler"
150
+ name : " 📠APK Artifact Handler"
159
151
runs-on : ubuntu-latest
160
152
needs : build-android
161
153
outputs :
162
154
apk_path : ${{ steps.download.outputs.APK_PATH }}
163
155
steps :
164
- # ========================
165
- # 🛠️ Environment Setup
166
- # ========================
167
- - name : " 📦 Checkout Repository"
156
+ # Environment Setup
157
+ - name : " 📠Checkout Repository"
168
158
uses : actions/checkout@v4
169
159
170
160
- name : " âš™ï¸ Setup Node.js"
171
161
uses : actions/setup-node@v4
172
162
with :
173
163
node-version : 20.x
174
- # NOTE: Removed cache setting here as well
175
164
176
- - name : " 🔧 Install pnpm"
165
+ - name : " 🔠Install pnpm"
177
166
run : |
178
167
npm install -g pnpm
179
168
pnpm --version
180
169
181
- - name : " 📦 Install Dependencies"
170
+ - name : " 📠Install Dependencies"
182
171
run : pnpm install --frozen-lockfile
183
172
184
- # ========================
185
- # 📦 Dependency Management
186
- # ========================
187
- - name : " 🧰 Install Build Tools"
173
+ # Dependency Management
174
+ - name : " 🧠Install Build Tools"
188
175
run : |
189
176
pnpm add -g eas-cli@latest
190
177
sudo apt-get update
191
178
sudo apt-get install -y jq curl dotenv
192
179
193
- # ========================
194
- # 🔍 Build Monitoring
195
- # ========================
180
+ # Build Monitoring
196
181
- name : " â³ Wait for Build Completion"
197
182
run : |
198
183
echo "â° Monitoring build status..."
199
184
cd $GITHUB_WORKSPACE
200
185
BUILD_ID=${{ needs.build-android.outputs.build_id }}
201
- echo "🔍 Starting build monitoring for BUILD_ID: $BUILD_ID"
186
+ echo "🔠Starting build monitoring for BUILD_ID: $BUILD_ID"
202
187
203
188
# Initial check without JSON for better error visibility
204
189
eas build:view $BUILD_ID || true
@@ -209,10 +194,10 @@ jobs:
209
194
210
195
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
211
196
echo -e "\n=== Attempt $((RETRY_COUNT+1))/$MAX_RETRIES ==="
212
-
197
+
213
198
# Fetch build status in JSON format
214
199
BUILD_STATUS_JSON=$(eas build:view --json $BUILD_ID)
215
- echo "📄 Raw API response: $BUILD_STATUS_JSON"
200
+ echo "📠Raw API response: $BUILD_STATUS_JSON"
216
201
217
202
# Validate JSON and check for empty response
218
203
if ! echo "$BUILD_STATUS_JSON" | jq empty >/dev/null 2>&1 || [[ -z "$BUILD_STATUS_JSON" ]]; then
@@ -225,7 +210,7 @@ jobs:
225
210
BUILD_STATUS=$(echo "$BUILD_STATUS_JSON" | jq -r '.status')
226
211
ERROR_MESSAGE=$(echo "$BUILD_STATUS_JSON" | jq -r '.error.message // empty')
227
212
228
- echo "🔍 Parsed status: $BUILD_STATUS"
213
+ echo "🔠Parsed status: $BUILD_STATUS"
229
214
[[ -n "$ERROR_MESSAGE" ]] && echo "⌠Error message: $ERROR_MESSAGE"
230
215
231
216
case $BUILD_STATUS in
@@ -243,7 +228,7 @@ jobs:
243
228
echo "$BUILD_STATUS_JSON" | jq .
244
229
exit 1
245
230
;;
246
- "NEW"|"IN_QUE "|"IN_PROGRESS"|"PENDING")
231
+ "NEW"|"IN_QUEUE "|"IN_PROGRESS"|"PENDING")
247
232
echo "â³ Build is still in progress..."
248
233
;;
249
234
*)
@@ -261,101 +246,95 @@ jobs:
261
246
env :
262
247
EXPO_TOKEN : ${{ secrets.EXPO_TOKEN }}
263
248
264
- # ========================
265
- # 📦 Artifact Handling
266
- # ========================
267
- - name : " 📥 Download APK"
249
+ # Artifact Handling
250
+ - name : " 📠Download APK"
268
251
id : download
269
252
run : |
270
- echo "🔽 Retrieving APK URL..."
253
+ echo "🔠Retrieving APK URL..."
271
254
APK_URL=$(eas build:view --json ${{ needs.build-android.outputs.build_id }} | jq -r '.artifacts.buildUrl')
272
255
if [[ -z "$APK_URL" || "$APK_URL" == "null" ]]; then
273
256
echo "⌠Error: No APK URL found!"
274
257
exit 1
275
258
fi
276
- echo "📥 Downloading APK from $APK_URL..."
259
+ echo "📠Downloading APK from $APK_URL..."
277
260
curl -L "$APK_URL" -o app-release.apk
278
261
echo "APK_PATH=app-release.apk" >> $GITHUB_OUTPUT
279
262
280
- - name : " 📤 Upload Artifact"
263
+ - name : " 📠Upload Artifact"
281
264
uses : actions/upload-artifact@v4
282
265
with :
283
266
name : android-apk
284
267
path : app-release.apk
285
268
286
269
generate-changelog :
287
- name : " 📜 Changelog Generator"
270
+ name : " 📠Changelog Generator"
288
271
runs-on : ubuntu-latest
289
272
needs : build-android
290
273
outputs :
291
274
changelog : ${{ steps.changelog.outputs.CHANGELOG }}
292
275
steps :
293
- # ========================
294
- # 🛠️ Repository Setup
295
- # ========================
296
- - name : " 📂 Checkout with Full History"
276
+ # Repository Setup
277
+ - name : " 📠Checkout with Full History"
297
278
uses : actions/checkout@v4
298
279
with :
299
280
fetch-depth : 0
300
281
301
- # ========================
302
- # 📄 Changelog Generation
303
- # ========================
304
- - name : " 📋 Create Release Notes"
282
+ # Changelog Generation
283
+ - name : " 📠Create Release Notes"
305
284
id : changelog
306
285
run : |
307
- echo "📝 Generating changelog from git history..."
286
+ echo "📠Generating changelog from git history..."
308
287
CHANGELOG=$(git log --pretty=format:"- %s (%h) by %an" -n 15)
309
288
echo "$CHANGELOG" > changelog.txt
310
289
311
290
# FIXED OUTPUT HANDLING (ONLY CHANGE)
312
291
delimiter=$(openssl rand -hex 6)
313
- echo "CHANGELOG<<${ delimiter} " >> $GITHUB_OUTPUT
292
+ echo "CHANGELOG<<$delimiter" >> $GITHUB_OUTPUT
314
293
cat changelog.txt >> $GITHUB_OUTPUT
315
- echo "${ delimiter} " >> $GITHUB_OUTPUT
294
+ echo "$delimiter" >> $GITHUB_OUTPUT
316
295
317
- - name : " 📤 Upload Changelog"
296
+ - name : " 📠Upload Changelog"
318
297
uses : actions/upload-artifact@v4
319
298
with :
320
299
name : changelog
321
300
path : changelog.txt
322
301
323
302
create-release :
324
- name : " 🚀 Smart Release Publisher"
303
+ name : " 🚠Smart Release Publisher"
325
304
runs-on : ubuntu-latest
326
- needs : [build-android, download-apk, generate-changelog]
305
+ needs :
306
+ - build-android
307
+ - download-apk
308
+ - generate-changelog
327
309
steps :
328
- # ========================
329
- # 📥 Artifact Retrieval
330
- # ========================
331
- - name : " 📦 Get APK Artifact"
310
+ # Artifact Retrieval
311
+ - name : " 📠Get APK Artifact"
332
312
uses : actions/download-artifact@v4
333
313
with :
334
314
name : android-apk
335
315
336
- - name : " 📄 Get Changelog"
316
+ - name : " 📠Get Changelog"
337
317
uses : actions/download-artifact@v4
338
318
with :
339
319
name : changelog
340
320
341
- # ========================
342
- # 🏷️ Release Creation
343
- # ========================
344
- - name : " 🎚️ Determine Release Type"
321
+ # Release Creation
322
+ - name : " ðŸŽï¸ Determine Release Type"
345
323
id : release-type
346
324
run : |
347
- echo "🔍 Detecting release type..."
325
+ echo "🔠Detecting release type..."
348
326
if [ "${{ needs.build-android.outputs.is_production }}" = "true" ]; then
349
- echo "🟢 Production release detected"
327
+ echo "🟠Production release detected"
350
328
RELEASE_TAG="v${{ needs.build-android.outputs.app_version }}"
351
329
RELEASE_TITLE="Production Release v${{ needs.build-android.outputs.app_version }}"
352
330
else
353
- echo "🟡 Nightly build detected"
331
+ echo "🟠Nightly build detected"
354
332
RELEASE_TAG="nightly-${{ needs.build-android.outputs.build_date }}"
355
333
RELEASE_TITLE="Nightly Build (${{ needs.build-android.outputs.build_date }})"
356
334
fi
357
335
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_OUTPUT
358
- - name : " 🎉 Publish GitHub Release"
336
+
337
+ - name : " 🎠Publish GitHub Release"
359
338
uses : softprops/action-gh-release@v2
360
339
with :
361
340
tag_name : ${{ steps.release-type.outputs.RELEASE_TAG }}
0 commit comments