Skip to content

Commit bb78d17

Browse files
committed
Add GitHub Actions for Tauri release
1 parent b269750 commit bb78d17

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*' # 当你推送以 'v' 开头的 tag 时触发(例如 v1.0.0)
6+
7+
jobs:
8+
release:
9+
permissions:
10+
contents: write # 允许创建 Release
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
platform: [macos-latest, ubuntu-22.04, windows-latest]
15+
16+
runs-on: ${{ matrix.platform }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: setup node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: lts/*
24+
25+
- name: install Rust stable
26+
uses: dtolnay/rust-toolchain@stable
27+
28+
# Linux 系统需要安装 Tauri 特定的系统依赖
29+
- name: install dependencies (ubuntu only)
30+
if: matrix.platform == 'ubuntu-22.04'
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
34+
35+
# 安装前端依赖(根据你的包管理器调整:npm/yarn/pnpm)
36+
- name: install frontend dependencies
37+
run: npm install
38+
39+
# 使用 Tauri 官方 Action 编译并发布
40+
- name: build tauri app
41+
uses: tauri-apps/tauri-action@v0
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
tagName: ${{ github.ref_name }} # 使用触发工作流的 tag 名称
46+
releaseName: 'Serial Tool ${{ github.ref_name }}'
47+
releaseBody: '自动编译发布的版本。请在下方下载对应系统的安装包。'
48+
releaseDraft: false
49+
prerelease: false

0 commit comments

Comments
 (0)