@@ -59,20 +59,42 @@ jobs:
59
59
run : |
60
60
BUILD_ID=${{ needs.build-android.outputs.build_id }}
61
61
RETRY_COUNT=0
62
- MAX_RETRIES=50
62
+ MAX_RETRIES=100
63
+
63
64
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
64
65
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
66
77
67
78
BUILD_STATUS=$(echo "$BUILD_STATUS_JSON" | jq -r '.status' 2>/dev/null)
79
+
80
+ # Ensure status is valid
68
81
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
71
86
fi
72
87
73
88
echo "Current Status: $BUILD_STATUS"
89
+
74
90
if [[ "$BUILD_STATUS" == "finished" ]]; then
75
91
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
+
76
98
echo "APK_URL=$APK_URL" >> $GITHUB_ENV
77
99
break
78
100
elif [[ "$BUILD_STATUS" == "errored" ]]; then
@@ -83,6 +105,11 @@ jobs:
83
105
RETRY_COUNT=$((RETRY_COUNT+1))
84
106
sleep 30
85
107
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
86
113
env :
87
114
EXPO_TOKEN : ${{ secrets.EXPO_TOKEN }}
88
115
0 commit comments