File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build Release
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*" # 推送 v1.0.0 即可自动构建 release
7+
8+ jobs :
9+ build :
10+ runs-on : ${{ matrix.os }}
11+ strategy :
12+ matrix :
13+ include :
14+ - os : macos-latest
15+ build_script : pnpm dist:mac:arm64
16+ artifact_pattern : " dist/*.dmg"
17+ - os : windows-latest
18+ build_script : pnpm dist:win:x64
19+ artifact_pattern : " dist/*.exe"
20+ - os : ubuntu-latest
21+ build_script : pnpm dist:linux:x64
22+ artifact_pattern : " dist/*"
23+
24+ steps :
25+ - name : Checkout code
26+ uses : actions/checkout@v4
27+
28+ - name : Install Node
29+ uses : actions/setup-node@v4
30+ with :
31+ node-version : 20
32+
33+ - name : Install pnpm
34+ run : npm i -g pnpm
35+
36+ - name : Install dependencies
37+ run : pnpm install --frozen-lockfile
38+
39+ - name : Build Electron App
40+ run : ${{ matrix.build_script }}
41+
42+ # 上传构建产物到 Release
43+ - name : Upload Release Artifacts
44+ uses : softprops/action-gh-release@v2
45+ with :
46+ files : ${{ matrix.artifact_pattern }}
47+ env :
48+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
You can’t perform that action at this time.
0 commit comments