|
1 | | -name: Release Electron App |
2 | | - |
3 | | -# 由 semantic-release 创建的 v* tag 触发:构建 Electron 安装包并附加到对应 Release |
4 | | -on: |
5 | | - push: |
6 | | - tags: ['v*'] |
7 | | - |
8 | | -# 上传构建产物到 GitHub Release 需要写权限 |
9 | | -permissions: |
10 | | - contents: write |
11 | | - |
12 | | -jobs: |
13 | | - lint-test: |
14 | | - runs-on: ubuntu-latest |
15 | | - steps: |
16 | | - - uses: actions/checkout@v4 |
17 | | - - uses: actions/setup-node@v4 |
18 | | - with: |
19 | | - node-version: 20 |
20 | | - cache: 'npm' |
21 | | - cache-dependency-path: client/package-lock.json |
22 | | - - run: cd client && npm ci |
23 | | - - run: cd client && npm run lint |
24 | | - - run: cd client && npm run test -- --run |
25 | | - |
26 | | - build: |
27 | | - needs: lint-test |
28 | | - strategy: |
29 | | - matrix: |
30 | | - os: [windows-latest, macos-latest] |
31 | | - runs-on: ${{ matrix.os }} |
32 | | - steps: |
33 | | - - uses: actions/checkout@v4 |
34 | | - - uses: actions/setup-node@v4 |
35 | | - with: |
36 | | - node-version: 20 |
37 | | - cache: 'npm' |
38 | | - cache-dependency-path: client/package-lock.json |
39 | | - - run: cd client && npm ci |
40 | | - - run: cd client && npm run electron:build |
41 | | - - uses: actions/upload-artifact@v4 |
42 | | - with: |
43 | | - name: release-${{ matrix.os }} |
44 | | - path: client/release/*.{exe,dmg,AppImage} |
45 | | - |
46 | | - release: |
47 | | - needs: build |
48 | | - runs-on: ubuntu-latest |
49 | | - steps: |
50 | | - - uses: actions/download-artifact@v4 |
51 | | - with: |
52 | | - pattern: release-* |
53 | | - - uses: softprops/action-gh-release@v2 |
54 | | - with: |
55 | | - files: release-*/* |
| 1 | +name: Release Electron App |
| 2 | + |
| 3 | +# 由 semantic-release 创建的 v* tag 触发:构建 Electron 安装包并附加到对应 Release |
| 4 | +on: |
| 5 | + push: |
| 6 | + tags: ['v*'] |
| 7 | + |
| 8 | +# 上传构建产物到 GitHub Release 需要写权限 |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + lint-test: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - uses: actions/setup-node@v4 |
| 18 | + with: |
| 19 | + node-version: 20 |
| 20 | + cache: 'npm' |
| 21 | + cache-dependency-path: client/package-lock.json |
| 22 | + - run: cd client && npm ci |
| 23 | + - run: cd client && npm run lint |
| 24 | + - run: cd client && npm run test -- --run |
| 25 | + |
| 26 | + build: |
| 27 | + needs: lint-test |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + os: [windows-latest, macos-latest] |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v4 |
| 34 | + - uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version: 20 |
| 37 | + cache: 'npm' |
| 38 | + cache-dependency-path: client/package-lock.json |
| 39 | + - run: cd client && npm ci |
| 40 | + - run: cd client && npm run electron:build |
| 41 | + - uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: release-${{ matrix.os }} |
| 44 | + path: client/release/*.{exe,dmg,AppImage} |
| 45 | + |
| 46 | + release: |
| 47 | + needs: build |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/download-artifact@v4 |
| 51 | + with: |
| 52 | + pattern: release-* |
| 53 | + - uses: softprops/action-gh-release@v2 |
| 54 | + with: |
| 55 | + files: release-*/* |
0 commit comments