Skip to content

Workflow file for this run

# build.yml
name: Build
on:
push:
tags:
- 'v*' # 在推送的标签以"v"开头时执行
jobs:
release:
name: build and release electron app
runs-on: ${{ matrix.os }} # 使用矩阵策略来确定操作系统
strategy:
fail-fast: false
matrix: # 这个定义会启用2个系统进行打包
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- name: Checkout

Check failure on line 20 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

You have an error in your yaml syntax on line 20
uses: actions/checkout@v4
# 安装 node
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
# 安装 pnpm
- name: Install Pnpm
uses: pnpm/action-setup@v2
with:
version: 8
# 安装 包
- name: Install Dependencies
run: pnpm install
# 打包
- name: Build Electron App
run: pnpm run build:desktop
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Cleanup Artifacts for Windows
if: matrix.os == 'windows-latest'
run: |
npx rimraf "packages/desktop/release/!(*.exe)"
- name: Cleanup Artifacts for MacOS
if: matrix.os == 'macos-latest'
run: |
npx rimraf "packages/desktop/release/!(*.dmg)"
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: packages/desktop/release
- name: release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: 'packages/desktop/release/**'
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}