From e41ae1cd7f9ea005f16e22c22295736fe798fab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asger=20Geel=20Weirs=C3=B8e?= Date: Wed, 6 May 2026 13:24:20 +0200 Subject: [PATCH] ci: use gitea-release-action@v1 for release upload Replaces the manual curl-based release creation with the standard action, consistent with other Gitea repos. Also bumps checkout to @v4. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/release.yml | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 4f9b634..6c60166 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -9,7 +9,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install system dependencies run: | @@ -41,26 +41,13 @@ jobs: cp builddir/ahfail-display dist/ tar czf ahfail-linux-x86_64.tar.gz -C dist . - - name: Create Gitea release and upload asset + - name: Upload release asset # Requires a GITEA_TOKEN secret with write:repository scope. # Create it in repo Settings → Secrets. - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - GITEA_URL: https://gitea.weircon.dk - REPO: agw/gtk-ahfail - TAG: ${{ github.ref_name }} - run: | - set -euo pipefail - RELEASE_ID=$(curl -f -X POST \ - "${GITEA_URL}/api/v1/repos/${REPO}/releases" \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/json" \ - -d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"draft\":false}" \ - | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])") - - [ -n "${RELEASE_ID}" ] || { echo "ERROR: empty RELEASE_ID from API"; exit 1; } - - curl -f -X POST \ - "${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -F "attachment=@ahfail-linux-x86_64.tar.gz" + uses: https://gitea.com/actions/gitea-release-action@v1 + with: + token: ${{ secrets.GITEA_TOKEN }} + server_url: ${{ github.server_url }} + tag_name: ${{ github.ref_name }} + name: ${{ github.ref_name }} + files: ahfail-linux-x86_64.tar.gz