fix(ci): replace non-existent gitea-release-action with Gitea API calls
All checks were successful
CI / Build All Platforms (Tag/Main only) (push) Has been skipped
CI / Type Check & Lint (push) Successful in 7s
CI / Build Test (Current Platform) (push) Successful in 6s
Release / build-and-release (push) Successful in 37s

- Use curl to directly call Gitea API for release creation
- Upload binaries as release assets using API
- Fixes authentication error in CI workflow
This commit is contained in:
2025-10-19 13:38:24 +00:00
parent 37ccbf58fd
commit c3441946cb

View File

@@ -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: |