diff --git a/.gitea/workflows/android-build.yml b/.gitea/workflows/android-build.yml index 27df0da..d302609 100644 --- a/.gitea/workflows/android-build.yml +++ b/.gitea/workflows/android-build.yml @@ -96,7 +96,7 @@ jobs: # ── 9. Publish to Gitea generic package registry ───────────────────────── - name: Publish APKs to Gitea package registry env: - TOKEN: ${{ secrets.GITEA_TOKEN }} + TOKEN: ${{ github.token }} run: | set -euo pipefail VERSION="${{ github.run_number }}" @@ -105,13 +105,20 @@ jobs: upload() { local src="$1" dst_name="$2" echo "→ Uploading $dst_name (version $VERSION)…" - HTTP=$(curl --silent --show-error --write-out "%{http_code}" \ + # --output /dev/null discards the body; --write-out captures only the 3-digit code + HTTP=$(curl --silent --show-error \ + --output /dev/null --write-out "%{http_code}" \ -X PUT \ -H "Authorization: token $TOKEN" \ --upload-file "$src" \ "$BASE/$VERSION/$dst_name") if [[ "$HTTP" != "20"* ]]; then echo "✗ Upload failed — HTTP $HTTP" + # Retry once with verbose output for diagnostics + curl -v -X PUT \ + -H "Authorization: token $TOKEN" \ + --upload-file "$src" \ + "$BASE/$VERSION/$dst_name" 2>&1 | tail -30 || true exit 1 fi echo "✓ $dst_name → $BASE/$VERSION/$dst_name"