-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.25 KB
/
ci-cd.yml
File metadata and controls
48 lines (40 loc) · 1.25 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
name: Electron CI/CD
on:
push:
tags: ['v*'] # 只有打 tag 时才触发发布
jobs:
build-and-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest] # 移除 macos-latest
steps:
- name: 拉取代码
uses: actions/checkout@v4
- name: 安装 Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: 安装依赖
run: npm ci
- name: 构建项目
run: npm run build
- name: 打包 Electron 应用
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
npm run release:win
else
npm run release:linux
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ✅ 使用内置 Token
- name: 上传安装包到 GitHub Releases
uses: softprops/action-gh-release@v1
with:
files: |
dist/LecCheckIn\ Setup\ *.exe # ✅ 匹配所有带空格的 .exe 文件
dist/LecCheckIn\ Setup\ *.exe.blockmap # ✅ 匹配 blockmap 文件
dist/latest.yml # ✅ 自动更新必需
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}