Repository navigation
Release Tauri App #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Electron App | |
| # 由 semantic-release 创建的 v* tag 触发:构建 Electron 安装包并附加到对应 Release | |
| on: | |
| push: | |
| tags: ['v*'] | |
| # 兜底触发:semantic-release 若以内置 GITHUB_TOKEN 推 tag, | |
| # GitHub 防递归机制不会派发 push 事件,导致本工作流从不运行、 | |
| # Release 资产为空(latest.yml 404)。Release 发布事件可正常触发补跑。 | |
| release: | |
| types: [published] | |
| # 手动兜底:在 UI 选择对应 tag 运行,用于补发历史版本资产 | |
| workflow_dispatch: | |
| # 上传构建产物到 GitHub Release 需要写权限 | |
| permissions: | |
| contents: write | |
| # 同一 tag 的多个触发源(push/release)串行执行,避免重复上传竞争 | |
| concurrency: | |
| group: release-electron-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| jobs: | |
| lint-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: client/package-lock.json | |
| - run: cd client && npm ci | |
| - run: cd client && npm run lint | |
| - run: cd client && npm run test -- --run | |
| build: | |
| needs: lint-test | |
| strategy: | |
| matrix: | |
| os: [windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: client/package-lock.json | |
| - run: cd client && npm ci | |
| - run: cd client && npm run electron:build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-${{ matrix.os }} | |
| # 注意:@actions/glob 不支持 {a,b} 花括号展开,必须逐行列出; | |
| # latest*.yml 与 *.blockmap 是 electron-updater 自动更新的必需文件 | |
| path: | | |
| client/release/*.exe | |
| client/release/*.dmg | |
| client/release/*.AppImage | |
| client/release/*.blockmap | |
| client/release/latest*.yml | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: release-* | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: release-*/* |