@@ -67,35 +67,45 @@ jobs:
67
67
- name : Wait for EAS Build to Complete
68
68
run : |
69
69
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
+
70
79
RETRY_COUNT=0
71
80
MAX_RETRIES=100
81
+ SLEEP_TIME=30
72
82
73
83
while [[ $RETRY_COUNT -lt $MAX_RETRIES ]]; do
74
84
BUILD_STATUS_JSON=$(npx eas build:view --build-id $BUILD_ID --json 2>/dev/null)
75
85
76
86
# Debug: Log raw response to see what is returned
77
87
echo "Build status raw response: $BUILD_STATUS_JSON"
78
-
79
- # Ensure response is not empty
88
+
89
+ # Check if response is empty
80
90
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 ..."
82
92
RETRY_COUNT=$((RETRY_COUNT+1))
83
- sleep 30
93
+ sleep $SLEEP_TIME
84
94
continue
85
95
fi
86
-
96
+
87
97
BUILD_STATUS=$(echo "$BUILD_STATUS_JSON" | jq -r '.status' 2>/dev/null)
88
98
89
- # Ensure status is valid
99
+ # Check if status is valid
90
100
if [[ -z "$BUILD_STATUS" || "$BUILD_STATUS" == "null" ]]; then
91
101
echo "Error: Build status is empty! Retrying..."
92
102
RETRY_COUNT=$((RETRY_COUNT+1))
93
- sleep 30
103
+ sleep $SLEEP_TIME
94
104
continue
95
105
fi
96
106
97
- echo "Current Status: $BUILD_STATUS"
98
-
107
+ echo "Current Build Status: $BUILD_STATUS"
108
+
99
109
if [[ "$BUILD_STATUS" == "finished" ]]; then
100
110
APK_URL=$(echo "$BUILD_STATUS_JSON" | jq -r '.artifacts.buildUrl' 2>/dev/null)
101
111
@@ -110,9 +120,9 @@ jobs:
110
120
echo "EAS build failed."
111
121
exit 1
112
122
fi
113
-
123
+
114
124
RETRY_COUNT=$((RETRY_COUNT+1))
115
- sleep 30
125
+ sleep $SLEEP_TIME
116
126
done
117
127
118
128
if [[ $RETRY_COUNT -eq $MAX_RETRIES ]]; then
@@ -160,32 +170,4 @@ jobs:
160
170
echo "CHANGELOG=$GITHUB_ENV" >> $GITHUB_OUTPUT
161
171
162
172
- 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