-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (89 loc) · 3 KB
/
Copy pathrelease.yml
File metadata and controls
100 lines (89 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
name: release ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
args: "--target universal-apple-darwin"
- platform: ubuntu-latest
args: ""
- platform: windows-latest
args: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
librsvg2-dev \
libayatana-appindicator3-dev \
patchelf \
build-essential
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: app/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: app/src-tauri -> target
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
working-directory: app
# 从发布日志 docs/src/content/release/<版本>.md 提取正文(去掉开头的 frontmatter)
# 作为 Release body;没有对应文件时回退到一句通用说明。
- name: Extract release notes
id: notes
shell: bash
run: |
version="${GITHUB_REF_NAME#v}"
file="docs/src/content/release/${version}.md"
if [ -f "$file" ]; then
# 删除第一行到第二个 `---`(即整段 YAML frontmatter)
body="$(sed '1,/^---[[:space:]]*$/d' "$file")"
else
body="桌面多云存储管理器。各平台安装包见下方 Assets。"
fi
{
echo "body<<NEBULA_NOTES_EOF"
echo "$body"
echo "NEBULA_NOTES_EOF"
} >> "$GITHUB_OUTPUT"
- name: Build and release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 更新签名密钥(在仓库 Settings → Secrets 配置),缺失时 updater 产物不会签名。
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
projectPath: app
tagName: ${{ github.ref_name }}
releaseName: "${{ github.ref_name }}"
releaseBody: ${{ steps.notes.outputs.body }}
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}