Skip to content

Commit bf2e13d

Browse files
Adding verbose logging to download APK job.
1 parent 1cd7086 commit bf2e13d

File tree

1 file changed

+22
-40
lines changed

1 file changed

+22
-40
lines changed

.github/workflows/eas-android-build.yml

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -67,35 +67,45 @@ jobs:
6767
- name: Wait for EAS Build to Complete
6868
run: |
6969
BUILD_ID=${{ needs.build-android.outputs.build_id }}
70+
71+
if [[ -z "$BUILD_ID" || "$BUILD_ID" == "null" ]]; then
72+
echo "Error: BUILD_ID is missing or invalid!"
73+
exit 1
74+
fi
75+
76+
echo "Waiting for EAS Build to complete..."
77+
echo "BUILD_ID: $BUILD_ID"
78+
7079
RETRY_COUNT=0
7180
MAX_RETRIES=100
81+
SLEEP_TIME=30
7282
7383
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
7484
BUILD_STATUS_JSON=$(npx eas build:view --build-id $BUILD_ID --json 2>/dev/null)
7585
7686
# Debug: Log raw response to see what is returned
7787
echo "Build status raw response: $BUILD_STATUS_JSON"
78-
79-
# Ensure response is not empty
88+
89+
# Check if response is empty
8090
if [[ -z "$BUILD_STATUS_JSON" || "$BUILD_STATUS_JSON" == "null" ]]; then
81-
echo "Error: Failed to fetch build status! Retrying..."
91+
echo "Error: Failed to fetch build status! Retrying in $SLEEP_TIME seconds..."
8292
RETRY_COUNT=$((RETRY_COUNT+1))
83-
sleep 30
93+
sleep $SLEEP_TIME
8494
continue
8595
fi
86-
96+
8797
BUILD_STATUS=$(echo "$BUILD_STATUS_JSON" | jq -r '.status' 2>/dev/null)
8898
89-
# Ensure status is valid
99+
# Check if status is valid
90100
if [[ -z "$BUILD_STATUS" || "$BUILD_STATUS" == "null" ]]; then
91101
echo "Error: Build status is empty! Retrying..."
92102
RETRY_COUNT=$((RETRY_COUNT+1))
93-
sleep 30
103+
sleep $SLEEP_TIME
94104
continue
95105
fi
96106
97-
echo "Current Status: $BUILD_STATUS"
98-
107+
echo "Current Build Status: $BUILD_STATUS"
108+
99109
if [[ "$BUILD_STATUS" == "finished" ]]; then
100110
APK_URL=$(echo "$BUILD_STATUS_JSON" | jq -r '.artifacts.buildUrl' 2>/dev/null)
101111
@@ -110,9 +120,9 @@ jobs:
110120
echo "EAS build failed."
111121
exit 1
112122
fi
113-
123+
114124
RETRY_COUNT=$((RETRY_COUNT+1))
115-
sleep 30
125+
sleep $SLEEP_TIME
116126
done
117127
118128
if [[ $RETRY_COUNT -eq $MAX_RETRIES ]]; then
@@ -160,32 +170,4 @@ jobs:
160170
echo "CHANGELOG=$GITHUB_ENV" >> $GITHUB_OUTPUT
161171
162172
- name: Upload Changelog as artifact
163-
uses: actions/upload-artifact@v4
164-
with:
165-
name: changelog
166-
path: changelog.txt
167-
168-
create-release:
169-
name: Create GitHub Release
170-
runs-on: ubuntu-latest
171-
needs: [download-apk, generate-changelog]
172-
steps:
173-
- name: Download APK artifact
174-
uses: actions/download-artifact@v4
175-
with:
176-
name: android-apk
177-
178-
- name: Download Changelog artifact
179-
uses: actions/download-artifact@v4
180-
with:
181-
name: changelog
182-
183-
- name: Create GitHub Release
184-
uses: softprops/action-gh-release@v2
185-
with:
186-
tag_name: v1.0.${{ github.run_number }}
187-
name: Release v1.0.${{ github.run_number }}
188-
body_path: changelog.txt
189-
draft: false
190-
prerelease: false
191-
files: app-release.apk
173+
uses: actions

0 commit comments

Comments
 (0)