From a2b66d087f775cb037d886f440fd6577dfeac300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Wed, 27 May 2026 00:52:12 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20Release=20workflow?= =?UTF-8?q?=20=E2=80=94=20tag=20=E6=8E=A8=E9=80=81=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=20NSIS=20=E5=AE=89=E8=A3=85=E5=8C=85?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tag v* 触发 npx tauri build,NSIS 安装包上传到 GitHub Release Co-Authored-By: Claude Opus 4.7 --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7411286 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + build-and-release: + name: 构建 NSIS 安装包并发布 + runs-on: windows-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - run: npm ci + + - name: 安装 GNU 工具链 + run: | + rustup toolchain install stable-x86_64-pc-windows-gnu + rustup override set stable-x86_64-pc-windows-gnu + + - name: 添加 MinGW 到 PATH + run: echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Append + + - name: Tauri Build + run: npx tauri build + + - name: 上传安装包到 Release + run: | + $installer = Get-ChildItem -Path "src-tauri\target\release\bundle\nsis\*.exe" | Select-Object -First 1 + gh release upload $env:GITHUB_REF_NAME "$installer" --clobber + env: + GH_TOKEN: ${{ github.token }}