From c3441946cb6c0ba1ad84bac2d38ea8540d8c2417 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sun, 19 Oct 2025 13:38:24 +0000 Subject: [PATCH] fix(ci): replace non-existent gitea-release-action with Gitea API calls - Use curl to directly call Gitea API for release creation - Upload binaries as release assets using API - Fixes authentication error in CI workflow --- .gitea/workflows/release.yml | 47 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 9199a8a..98e4152 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -153,21 +153,38 @@ jobs: cat /tmp/release_notes.md - name: Create Gitea Release - uses: actions/gitea-release-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag_name: ${{ steps.version.outputs.version }} - name: NUPST ${{ steps.version.outputs.version }} - body_path: /tmp/release_notes.md - draft: false - prerelease: false - files: | - dist/binaries/nupst-linux-x64 - dist/binaries/nupst-linux-arm64 - dist/binaries/nupst-macos-x64 - dist/binaries/nupst-macos-arm64 - dist/binaries/nupst-windows-x64.exe - dist/binaries/SHA256SUMS.txt + run: | + VERSION="${{ steps.version.outputs.version }}" + RELEASE_NOTES=$(cat /tmp/release_notes.md) + + # Create the release + echo "Creating release for $VERSION..." + RELEASE_ID=$(curl -X POST -s \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/json" \ + "https://code.foss.global/api/v1/repos/serve.zone/nupst/releases" \ + -d "{ + \"tag_name\": \"$VERSION\", + \"name\": \"NUPST $VERSION\", + \"body\": $(jq -Rs . /tmp/release_notes.md), + \"draft\": false, + \"prerelease\": false + }" | jq -r '.id') + + echo "Release created with ID: $RELEASE_ID" + + # Upload binaries as release assets + for binary in dist/binaries/*; do + filename=$(basename "$binary") + echo "Uploading $filename..." + curl -X POST -s \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@$binary" \ + "https://code.foss.global/api/v1/repos/serve.zone/nupst/releases/$RELEASE_ID/assets?name=$filename" + done + + echo "All assets uploaded successfully" - name: Clean up old releases run: |