ci: retry gradlew up to 3x to survive transient CDN/network errors
All checks were successful
Android Build & Publish / android (push) Successful in 2m0s

This commit is contained in:
Giancarmine Salucci
2026-05-25 16:44:44 +02:00
parent 3204a19dc1
commit 697f7de9d1

View File

@@ -94,11 +94,21 @@ jobs:
- name: Build Debug APK
working-directory: android
run: ./gradlew assembleDebug --no-daemon
run: |
# Retry up to 3 times to survive transient network errors when the
# Gradle wrapper downloads its distribution from GitHub CDN.
for attempt in 1 2 3; do
./gradlew assembleDebug --no-daemon && break
[ "$attempt" -lt 3 ] && echo "Attempt $attempt failed — retrying in 30s..." && sleep 30 || exit 1
done
- name: Build Release APK (unsigned — no signing key required)
working-directory: android
run: ./gradlew assembleRelease --no-daemon
run: |
for attempt in 1 2 3; do
./gradlew assembleRelease --no-daemon && break
[ "$attempt" -lt 3 ] && echo "Attempt $attempt failed — retrying in 30s..." && sleep 30 || exit 1
done
# ── 9. Upload APKs as workflow artifacts ─────────────────────────────────
- name: Upload APKs as artifacts