From 4d167929c753887b7b8bb75c95b09af17ff51bf1 Mon Sep 17 00:00:00 2001 From: Ran <16112591+chen-ran@users.noreply.github.com> Date: Tue, 24 Feb 2026 22:57:46 +0800 Subject: [PATCH] fix(release): publish assets in single serial step Avoid race conditions during release uploads by moving asset publication out of matrix jobs and into one dedicated job. Co-authored-by: Cursor --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 242e2bcc..582afe9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,13 +82,41 @@ jobs: UPX_ARGS: "-3" run: scripts/release.sh - - name: Upload release assets + - name: Upload tar artifact + if: matrix.goos != 'windows' + uses: actions/upload-artifact@v4 + with: + name: release-assets-${{ matrix.goos }}-${{ matrix.goarch }} + path: dist/*.tar.gz + if-no-files-found: error + retention-days: 1 + + - name: Upload zip artifact + if: matrix.goos == 'windows' + uses: actions/upload-artifact@v4 + with: + name: release-assets-${{ matrix.goos }}-${{ matrix.goarch }} + path: dist/*.zip + if-no-files-found: error + retention-days: 1 + + publish-release: + needs: build-binaries + runs-on: ubuntu-latest + steps: + - name: Download release artifacts + uses: actions/download-artifact@v4 + with: + pattern: release-assets-* + path: dist + merge-multiple: true + + - name: Publish release assets uses: softprops/action-gh-release@v2 with: - files: | - dist/*.tar.gz - dist/*.zip + files: dist/* tag_name: ${{ github.ref_name }} + overwrite_files: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}