diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index c681e58..dd5eb25 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -113,13 +113,19 @@ jobs: run: | set -euo pipefail if [ -z "${PKG_TOKEN:-}" ]; then - echo "PACKAGES_TOKEN not set — skipping apt publish (the .deb is still a release asset)." + echo "REGISTRY_TOKEN not set — skipping apt publish (the .deb is still a release asset)." exit 0 fi OWNER="${{ github.repository_owner }}" URL="${{ github.server_url }}/api/packages/${OWNER}/debian/pool/stable/main/upload" for f in dist/*.deb; do echo "Uploading $(basename "$f") to the apt registry…" - curl -sS --fail --user "${OWNER}:${PKG_TOKEN}" --upload-file "$f" "$URL" + code=$(curl -sS -o /tmp/apt_upload.txt -w '%{http_code}' \ + --user "${OWNER}:${PKG_TOKEN}" --upload-file "$f" "$URL" || true) + case "$code" in + 2*) echo " uploaded ($code)";; + 409) echo " already published ($code) — skipping (registry versions are immutable)";; + *) echo " upload failed ($code):"; cat /tmp/apt_upload.txt || true; exit 1;; + esac done echo "apt source: deb ${{ github.server_url }}/api/packages/${OWNER}/debian stable main"