Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
416c8b07d2 | ||
|
|
32d4178875 | ||
|
|
697f7de9d1 |
@@ -94,11 +94,21 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Debug APK
|
- name: Build Debug APK
|
||||||
working-directory: android
|
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)
|
- name: Build Release APK (unsigned — no signing key required)
|
||||||
working-directory: android
|
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 ─────────────────────────────────
|
# ── 9. Upload APKs as workflow artifacts ─────────────────────────────────
|
||||||
- name: Upload APKs as artifacts
|
- name: Upload APKs as artifacts
|
||||||
@@ -170,13 +180,20 @@ jobs:
|
|||||||
MD_LIST=$(echo "$COMMIT_LOG" | sed 's/^/- /')
|
MD_LIST=$(echo "$COMMIT_LOG" | sed 's/^/- /')
|
||||||
BODY=$(printf '%s' "$MD_LIST" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))")
|
BODY=$(printf '%s' "$MD_LIST" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))")
|
||||||
|
|
||||||
# ── Create the release ───────────────────────────────────────────────
|
# ── Create release (idempotent: reuse existing tag if already present) ───
|
||||||
RESP=$(curl -sf -X POST "$API/releases" \
|
EXISTING=$(curl -sf "$API/releases/tags/$TAG" \
|
||||||
-H "Authorization: token $TOKEN" \
|
-H "Authorization: token $TOKEN" || true)
|
||||||
-H "Content-Type: application/json" \
|
if [[ -n "$EXISTING" ]]; then
|
||||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"Build $VERSION\",\"body\":$BODY,\"draft\":false,\"prerelease\":false}")
|
RELEASE_ID=$(echo "$EXISTING" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
RELEASE_ID=$(echo "$RESP" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
echo "Release $TAG already exists (id=$RELEASE_ID) — reusing."
|
||||||
echo "Created release $TAG (id=$RELEASE_ID)"
|
else
|
||||||
|
RESP=$(curl -sf -X POST "$API/releases" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"$TAG\",\"name\":\"Build $VERSION\",\"body\":$BODY,\"draft\":false,\"prerelease\":false}")
|
||||||
|
RELEASE_ID=$(echo "$RESP" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
|
echo "Created release $TAG (id=$RELEASE_ID)"
|
||||||
|
fi
|
||||||
|
|
||||||
# ── Upload APKs as release assets ────────────────────────────────────
|
# ── Upload APKs as release assets ────────────────────────────────────
|
||||||
upload_asset() {
|
upload_asset() {
|
||||||
|
|||||||
Reference in New Issue
Block a user