fix(ci): replace softprops/action-gh-release with gh CLI for server asset upload

softprops/action-gh-release defaults draft to false, which publishes
the release prematurely before the publish-release job runs. Switch to
gh release upload which only uploads assets without modifying release
state, avoiding both the premature publish and the duplicate draft
release issues caused by the GitHub API not returning drafts via
getReleaseByTag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
xintaofei
2026-04-16 00:55:18 +08:00
parent 8d0b0a2985
commit 3b331b15a4

View File

@@ -456,21 +456,15 @@ jobs:
- name: Upload to release (Unix)
if: runner.os != 'Windows'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
files: dist/${{ matrix.artifact }}.tar.gz
run: gh release upload "${{ github.ref_name }}" dist/${{ matrix.artifact }}.tar.gz --clobber
- name: Upload to release (Windows)
if: runner.os == 'Windows'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
files: dist/${{ matrix.artifact }}.zip
run: gh release upload "${{ github.ref_name }}" dist/${{ matrix.artifact }}.zip --clobber
build-docker:
needs: