Skip to content

Commit 6167d8f

Browse files
Added debugging to download apk job & increased max_retrties.
1 parent 06475a0 commit 6167d8f

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

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

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,42 @@ jobs:
5959
run: |
6060
BUILD_ID=${{ needs.build-android.outputs.build_id }}
6161
RETRY_COUNT=0
62-
MAX_RETRIES=50
62+
MAX_RETRIES=100
63+
6364
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
6465
BUILD_STATUS_JSON=$(npx eas build:view --build-id $BUILD_ID --json 2>/dev/null)
65-
echo "Build status response: $BUILD_STATUS_JSON"
66+
67+
# Debug: Log raw response to see what is returned
68+
echo "Build status raw response: $BUILD_STATUS_JSON"
69+
70+
# Ensure response is not empty
71+
if [[ -z "$BUILD_STATUS_JSON" || "$BUILD_STATUS_JSON" == "null" ]]; then
72+
echo "Error: Failed to fetch build status! Retrying..."
73+
RETRY_COUNT=$((RETRY_COUNT+1))
74+
sleep 30
75+
continue
76+
fi
6677
6778
BUILD_STATUS=$(echo "$BUILD_STATUS_JSON" | jq -r '.status' 2>/dev/null)
79+
80+
# Ensure status is valid
6881
if [[ -z "$BUILD_STATUS" || "$BUILD_STATUS" == "null" ]]; then
69-
echo "Error: Failed to fetch build status!"
70-
exit 1
82+
echo "Error: Build status is empty! Retrying..."
83+
RETRY_COUNT=$((RETRY_COUNT+1))
84+
sleep 30
85+
continue
7186
fi
7287
7388
echo "Current Status: $BUILD_STATUS"
89+
7490
if [[ "$BUILD_STATUS" == "finished" ]]; then
7591
APK_URL=$(echo "$BUILD_STATUS_JSON" | jq -r '.artifacts.buildUrl' 2>/dev/null)
92+
93+
if [[ -z "$APK_URL" || "$APK_URL" == "null" ]]; then
94+
echo "Error: APK URL not found!"
95+
exit 1
96+
fi
97+
7698
echo "APK_URL=$APK_URL" >> $GITHUB_ENV
7799
break
78100
elif [[ "$BUILD_STATUS" == "errored" ]]; then
@@ -83,6 +105,11 @@ jobs:
83105
RETRY_COUNT=$((RETRY_COUNT+1))
84106
sleep 30
85107
done
108+
109+
if [[ $RETRY_COUNT -eq $MAX_RETRIES ]]; then
110+
echo "Error: Build did not complete within the expected time!"
111+
exit 1
112+
fi
86113
env:
87114
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
88115

0 commit comments

Comments
 (0)