From b7cb7ef0c16cd126585e6c3f8ad8745bc8c8c169 Mon Sep 17 00:00:00 2001 From: CJACK Date: Mon, 23 Feb 2026 02:20:05 +0800 Subject: [PATCH] ci: use gh cli for release asset upload --- .github/workflows/release-artifacts.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 0c1bc0e..5fa13d1 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -174,10 +174,19 @@ jobs: fi - name: Upload Release Assets - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ env.RELEASE_TAG }} - files: | + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + TAG="${RELEASE_TAG}" + FILES=( dist/*.tar.gz dist/*.zip dist/sha256sums.txt + ) + + if gh release view "${TAG}" >/dev/null 2>&1; then + gh release upload "${TAG}" "${FILES[@]}" --clobber + else + gh release create "${TAG}" "${FILES[@]}" --title "${TAG}" --notes "" + fi