ci: use PACKAGE_TOKEN (bearer) for package registry upload
All checks were successful
Android Build & Publish / android (push) Successful in 2m0s

This commit is contained in:
Giancarmine Salucci
2026-05-25 09:00:17 +02:00
parent 58494f37ab
commit 49e51748d7

View File

@@ -103,11 +103,10 @@ jobs:
android/app/build/outputs/apk/release/app-release-unsigned.apk android/app/build/outputs/apk/release/app-release-unsigned.apk
retention-days: 30 retention-days: 30
# ── 10. Publish to Gitea generic package registry (best-effort) ────────── # ── 10. Publish to Gitea generic package registry ────────────────────────
- name: Publish APKs to Gitea package registry - name: Publish APKs to Gitea package registry
continue-on-error: true
env: env:
GITEA_ACTOR: ${{ gitea.actor }} TOKEN: ${{ secrets.PACKAGE_TOKEN }}
run: | run: |
set -euo pipefail set -euo pipefail
VERSION="${{ github.run_number }}" VERSION="${{ github.run_number }}"
@@ -119,15 +118,15 @@ jobs:
HTTP=$(curl --silent --show-error \ HTTP=$(curl --silent --show-error \
--output /dev/null --write-out "%{http_code}" \ --output /dev/null --write-out "%{http_code}" \
-X PUT \ -X PUT \
-u "gitea-actions:${{ secrets.GITEA_TOKEN }}" \ -H "Authorization: token $TOKEN" \
--upload-file "$src" \ --upload-file "$src" \
"$BASE/$VERSION/$dst_name") "$BASE/$VERSION/$dst_name")
echo " HTTP $HTTP" echo " HTTP $HTTP"
if [[ "$HTTP" == "20"* ]]; then if [[ "$HTTP" != "20"* ]]; then
echo "✓ $dst_name → $BASE/$VERSION/$dst_name" echo "✗ Upload failed — HTTP $HTTP"
else exit 1
echo "⚠ Package registry upload skipped (HTTP $HTTP) — download APKs from the workflow artifacts above"
fi fi
echo "✓ $dst_name → $BASE/$VERSION/$dst_name"
} }
upload android/app/build/outputs/apk/debug/app-debug.apk \ upload android/app/build/outputs/apk/debug/app-debug.apk \
@@ -135,3 +134,5 @@ jobs:
upload android/app/build/outputs/apk/release/app-release-unsigned.apk \ upload android/app/build/outputs/apk/release/app-release-unsigned.apk \
app-release-unsigned.apk app-release-unsigned.apk
echo "📦 Package index: $BASE/$VERSION/"