Skip to content

fix: builder

fix: builder #6

Workflow file for this run

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: 安装 Linux 依赖
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
- 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
- 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 }}