From e5a61bb36431be38d04bf04280d4f1d30b827af4 Mon Sep 17 00:00:00 2001 From: Hein Date: Wed, 8 Apr 2026 13:10:47 +0200 Subject: [PATCH] fix(ci): use Gitea API directly instead of softprops/action-gh-release --- .gitea/workflows/release.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 094338f..7f6cabe 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -49,9 +49,27 @@ jobs: done - name: Create release and upload assets - uses: softprops/action-gh-release@v2 - with: - files: unitdore-* - generate_release_notes: true + run: | + TAG="${GITHUB_REF_NAME}" + API="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases" + + RELEASE=$(curl -s -X POST "$API" \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":\"Release ${TAG}\"}") + + UPLOAD_URL=$(echo "$RELEASE" | grep -o '"upload_url":"[^"]*"' | cut -d'"' -f4) + if [ -z "$UPLOAD_URL" ]; then + echo "Failed to create release: $RELEASE" + exit 1 + fi + + for f in unitdore-*; do + echo "Uploading $f..." + curl -s -X POST "${UPLOAD_URL}?name=${f}" \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@${f}" > /dev/null + done env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}