Files
PathEditor/.github/workflows/release.yml
T

41 lines
1.0 KiB
YAML

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 create $env:GITHUB_REF_NAME "$installer" --title "$env:GITHUB_REF_NAME" --generate-notes
env:
GH_TOKEN: ${{ github.token }}