From 52e273280c9534f394ad4d44b1a9f618717200d7 Mon Sep 17 00:00:00 2001 From: MK Date: Tue, 12 May 2026 14:30:40 +0800 Subject: [PATCH] fix(ci): publish release as draft to support immutable releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The repo has GitHub's immutable-releases feature enabled. softprops/action-gh-release creates `prerelease: true, draft: false` releases in a single API call, so asset uploads happen after the release is already published — which fails on immutable repos with "Cannot upload asset ... to an immutable release". Switch to `draft: true` so the action attaches assets while the release is still mutable, then publish via `gh release edit` afterwards. The release.published event still fires once, after assets are in place. Closes: https://github.com/voidzero-dev/vite-plus/actions/runs/25673521844/job/75370568926 --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae1ca304a8..0cd16ec945 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -205,7 +205,7 @@ jobs: id: release with: body_path: ./RELEASE_BODY.md - draft: false + draft: true make_latest: ${{ inputs.npm_tag == 'latest' }} prerelease: ${{ inputs.npm_tag == 'alpha' }} name: vite-plus v${{ env.VERSION }} @@ -214,6 +214,11 @@ jobs: files: | installer-release/vp-setup-*.exe + - name: Publish GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release edit "v${VERSION}" --draft=false --repo "${{ github.repository }}" + - name: Send Discord notification if: ${{ inputs.npm_tag == 'latest' }} uses: tsickert/discord-webhook@b217a69502f52803de774ded2b1ab7c282e99645 # v7.0.0