mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-28 17:25:54 +08:00
ci: 添加 Release workflow — tag 推送自动构建 NSIS 安装包并发布
tag v* 触发 npx tauri build,NSIS 安装包上传到 GitHub Release Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -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 }}
|
||||
Reference in New Issue
Block a user