From 49e51748d706cb0b8045b91d2f5b16aa6cbde9bc Mon Sep 17 00:00:00 2001 From: Giancarmine Salucci Date: Mon, 25 May 2026 09:00:17 +0200 Subject: [PATCH] ci: use PACKAGE_TOKEN (bearer) for package registry upload --- .gitea/workflows/android-build.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/android-build.yml b/.gitea/workflows/android-build.yml index 385242b..6734777 100644 --- a/.gitea/workflows/android-build.yml +++ b/.gitea/workflows/android-build.yml @@ -103,11 +103,10 @@ jobs: android/app/build/outputs/apk/release/app-release-unsigned.apk 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 - continue-on-error: true env: - GITEA_ACTOR: ${{ gitea.actor }} + TOKEN: ${{ secrets.PACKAGE_TOKEN }} run: | set -euo pipefail VERSION="${{ github.run_number }}" @@ -119,15 +118,15 @@ jobs: HTTP=$(curl --silent --show-error \ --output /dev/null --write-out "%{http_code}" \ -X PUT \ - -u "gitea-actions:${{ secrets.GITEA_TOKEN }}" \ + -H "Authorization: token $TOKEN" \ --upload-file "$src" \ "$BASE/$VERSION/$dst_name") echo " HTTP $HTTP" - if [[ "$HTTP" == "20"* ]]; then - echo "✓ $dst_name → $BASE/$VERSION/$dst_name" - else - echo "⚠ Package registry upload skipped (HTTP $HTTP) — download APKs from the workflow artifacts above" + if [[ "$HTTP" != "20"* ]]; then + echo "✗ Upload failed — HTTP $HTTP" + exit 1 fi + echo "✓ $dst_name → $BASE/$VERSION/$dst_name" } 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 \ app-release-unsigned.apk + + echo "📦 Package index: $BASE/$VERSION/"