fix(ci): replace GitHub-specific action with Gitea API
Some checks failed
Build and Release / Create Release (push) Blocked by required conditions
Build and Release / Lint and Test (push) Successful in 42m11s
Build and Release / Build Docker Image (push) Failing after 17s
Build and Release / Build Binaries (arm64, darwin) (push) Failing after 1m22s
Build and Release / Build Binaries (amd64, darwin) (push) Has been cancelled
Build and Release / Build Binaries (amd64, linux) (push) Has been cancelled
Build and Release / Build Binaries (amd64, windows) (push) Has been cancelled
Build and Release / Build Binaries (arm64, linux) (push) Has been cancelled
Some checks failed
Build and Release / Create Release (push) Blocked by required conditions
Build and Release / Lint and Test (push) Successful in 42m11s
Build and Release / Build Docker Image (push) Failing after 17s
Build and Release / Build Binaries (arm64, darwin) (push) Failing after 1m22s
Build and Release / Build Binaries (amd64, darwin) (push) Has been cancelled
Build and Release / Build Binaries (amd64, linux) (push) Has been cancelled
Build and Release / Build Binaries (amd64, windows) (push) Has been cancelled
Build and Release / Build Binaries (arm64, linux) (push) Has been cancelled
softprops/action-gh-release doesn't work on Gitea Actions. Use direct Gitea API calls for creating releases and uploading assets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
aa3f249dbb
commit
3652f34234
@ -270,12 +270,14 @@ jobs:
|
||||
echo "changelog=${CHANGELOG}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: Gitea ${{ steps.version.outputs.version }}
|
||||
tag_name: ${{ steps.version.outputs.version }}
|
||||
body: |
|
||||
## Changes in ${{ steps.version.outputs.version }}
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
IS_PRERELEASE="false"
|
||||
if [[ "$VERSION" == *"-rc"* ]] || [[ "$VERSION" == *"-beta"* ]] || [[ "$VERSION" == *"-alpha"* ]]; then
|
||||
IS_PRERELEASE="true"
|
||||
fi
|
||||
|
||||
RELEASE_BODY="## Changes in ${VERSION}
|
||||
|
||||
${{ steps.changelog.outputs.changelog }}
|
||||
|
||||
@ -283,17 +285,44 @@ jobs:
|
||||
|
||||
| Platform | Architecture | Download |
|
||||
|----------|--------------|----------|
|
||||
| Linux | amd64 | `gitea-${{ steps.version.outputs.version }}-linux-amd64` |
|
||||
| Linux | arm64 | `gitea-${{ steps.version.outputs.version }}-linux-arm64` |
|
||||
| macOS | amd64 | `gitea-${{ steps.version.outputs.version }}-darwin-amd64` |
|
||||
| macOS | arm64 | `gitea-${{ steps.version.outputs.version }}-darwin-arm64` |
|
||||
| Windows | amd64 | `gitea-${{ steps.version.outputs.version }}-windows-amd64.exe` |
|
||||
| Linux | amd64 | gitea-${VERSION}-linux-amd64 |
|
||||
| Linux | arm64 | gitea-${VERSION}-linux-arm64 |
|
||||
| macOS | amd64 | gitea-${VERSION}-darwin-amd64 |
|
||||
| macOS | arm64 | gitea-${VERSION}-darwin-arm64 |
|
||||
| Windows | amd64 | gitea-${VERSION}-windows-amd64.exe |
|
||||
|
||||
## Checksums
|
||||
|
||||
SHA256 checksums are provided in `.sha256` files alongside each binary.
|
||||
files: dist/*
|
||||
draft: false
|
||||
prerelease: ${{ contains(steps.version.outputs.version, '-rc') || contains(steps.version.outputs.version, '-beta') || contains(steps.version.outputs.version, '-alpha') }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SHA256 checksums are provided in .sha256 files alongside each binary."
|
||||
|
||||
# Create release via Gitea API
|
||||
RELEASE_DATA=$(jq -n \
|
||||
--arg tag "$VERSION" \
|
||||
--arg name "Gitea $VERSION" \
|
||||
--arg body "$RELEASE_BODY" \
|
||||
--argjson prerelease "$IS_PRERELEASE" \
|
||||
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: $prerelease}')
|
||||
|
||||
RESPONSE=$(curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$RELEASE_DATA" \
|
||||
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases")
|
||||
|
||||
echo "Release response: $RESPONSE"
|
||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||
echo "Created release with ID: $RELEASE_ID"
|
||||
|
||||
# Upload assets
|
||||
for file in dist/*; do
|
||||
if [ -f "$file" ]; then
|
||||
filename=$(basename "$file")
|
||||
echo "Uploading $filename..."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "attachment=@$file" \
|
||||
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=$filename"
|
||||
echo "Uploaded $filename"
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user