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