Skip to content

Commit f831eab

Browse files
committed
Improve JitPack build monitoring in release workflow
- Remove unnecessary 30-second wait for tag propagation - Add intelligent polling of JitPack build status API - Poll every 30 seconds for up to 10 minutes maximum - Provide real-time feedback on build progress - Exit with success/failure based on actual build results - Include helpful links to artifacts and build logs
1 parent 6cdd135 commit f831eab

File tree

1 file changed

+42
-12
lines changed

1 file changed

+42
-12
lines changed

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,46 @@ jobs:
143143
draft: false
144144
prerelease: false
145145

146-
- name: Wait for tag propagation
147-
run: sleep 30
148-
149-
- name: Trigger JitPack build
146+
- name: Trigger and monitor JitPack build
150147
run: |
151-
echo "Triggering JitPack build for v$NEW_VERSION"
152-
response=$(curl -s "https://jitpack.io/com/github/wassertim/dynamodb-toolkit/v$NEW_VERSION")
153-
echo "JitPack response: $response"
154-
if [[ "$response" == *"Build started"* ]] || [[ "$response" == *"OK"* ]]; then
155-
echo "βœ… JitPack build triggered successfully"
156-
else
157-
echo "⚠️ JitPack build may have failed, check https://jitpack.io/#wassertim/dynamodb-toolkit"
158-
fi
148+
echo "πŸš€ Triggering JitPack build for v$NEW_VERSION"
149+
150+
# Trigger the build
151+
trigger_response=$(curl -s "https://jitpack.io/com/github/wassertim/dynamodb-toolkit/v$NEW_VERSION")
152+
echo "Trigger response: $trigger_response"
153+
154+
# Check build status with polling
155+
echo "πŸ“‹ Monitoring build status..."
156+
max_attempts=20 # 10 minutes max (30s * 20)
157+
attempt=1
158+
159+
while [ $attempt -le $max_attempts ]; do
160+
echo "πŸ” Checking build status (attempt $attempt/$max_attempts)..."
161+
162+
# Check build status via the builds API
163+
status_response=$(curl -s "https://jitpack.io/api/builds/com.github.wassertim/dynamodb-toolkit/v$NEW_VERSION")
164+
echo "Status response: $status_response"
165+
166+
if [[ "$status_response" == *'"status":"ok"'* ]]; then
167+
echo "βœ… JitPack build completed successfully!"
168+
echo "πŸ“¦ Artifact available at: https://jitpack.io/#wassertim/dynamodb-toolkit/v$NEW_VERSION"
169+
exit 0
170+
elif [[ "$status_response" == *'"status":"error"'* ]]; then
171+
echo "❌ JitPack build failed!"
172+
echo "πŸ”— Check logs at: https://jitpack.io/com/github/wassertim/dynamodb-toolkit/v$NEW_VERSION/build.log"
173+
exit 1
174+
elif [[ "$status_response" == *'"status":"building"'* ]]; then
175+
echo "⏳ Build in progress..."
176+
else
177+
echo "⏳ Build queued or starting..."
178+
fi
179+
180+
if [ $attempt -eq $max_attempts ]; then
181+
echo "⏰ Build timeout reached (10 minutes)"
182+
echo "πŸ”— Check status manually at: https://jitpack.io/#wassertim/dynamodb-toolkit"
183+
exit 1
184+
fi
185+
186+
sleep 30
187+
attempt=$((attempt + 1))
188+
done

0 commit comments

Comments
Β (0)