|
1 | | -name: Create Release |
| 1 | +name: Release on Tag |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - tags: |
6 | | - - "v*.*.*" |
| 5 | + tags: [ "v*.*.*" ] # e.g. v1.2.3 |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write # needed to create releases & upload assets |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: release-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
7 | 14 |
|
8 | 15 | jobs: |
| 16 | + build: |
| 17 | + name: Build on ${{ matrix.display_name }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + include: |
| 23 | + - os: macos-latest |
| 24 | + display_name: macOS x64 |
| 25 | + build_command: npx electron-builder --publish never --mac |
| 26 | + artifact_name: macOS-artifacts |
| 27 | + - os: windows-latest |
| 28 | + display_name: Windows x64 |
| 29 | + build_command: npx electron-builder --publish never --win --x64 |
| 30 | + artifact_name: windows-x64-artifacts |
| 31 | + - os: windows-latest |
| 32 | + display_name: Windows ia32 |
| 33 | + build_command: npx electron-builder --publish never --win --ia32 |
| 34 | + artifact_name: windows-ia32-artifacts |
| 35 | + - os: ubuntu-latest |
| 36 | + display_name: Linux x64 |
| 37 | + build_command: npx electron-builder --publish never --linux --x64 |
| 38 | + artifact_name: linux-x64-artifacts |
| 39 | + - os: ubuntu-latest |
| 40 | + display_name: Linux armv7l |
| 41 | + build_command: npx electron-builder --publish never --linux --armv7l |
| 42 | + artifact_name: linux-armv7l-artifacts |
| 43 | + - os: ubuntu-latest |
| 44 | + display_name: Linux arm64 |
| 45 | + build_command: npx electron-builder --publish never --linux --arm64 |
| 46 | + artifact_name: linux-arm64-artifacts |
| 47 | + |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + with: { fetch-depth: 0 } # helps release notes/changelogs |
| 51 | + |
| 52 | + - uses: actions/setup-node@v4 |
| 53 | + with: |
| 54 | + node-version: 20 |
| 55 | + cache: npm |
| 56 | + cache-dependency-path: package-lock.json |
| 57 | + |
| 58 | + - run: npm ci |
| 59 | + - run: npm run build |
| 60 | + - run: ${{ matrix.build_command }} |
| 61 | + |
| 62 | + - name: Upload build artifacts |
| 63 | + if: always() |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + name: ${{ matrix.artifact_name }} |
| 67 | + path: release/** |
| 68 | + if-no-files-found: error |
| 69 | + |
9 | 70 | release: |
| 71 | + needs: build |
10 | 72 | runs-on: ubuntu-latest |
11 | | - needs: [ ] # set to ["build"] if you keep both jobs in one workflow file |
12 | 73 | steps: |
13 | 74 | - uses: actions/checkout@v4 |
| 75 | + with: { fetch-depth: 0 } |
14 | 76 |
|
15 | | - # (Optional) Generate changelog via Conventional Commits |
16 | | - # - uses: googleapis/release-please-action@v4 |
17 | | - # with: ... |
18 | | - # If you prefer a quick native notes: |
19 | 77 | - name: Generate release notes |
20 | 78 | id: notes |
21 | 79 | uses: actions/github-script@v7 |
|
29 | 87 | - name: Download all artifacts |
30 | 88 | uses: actions/download-artifact@v4 |
31 | 89 | with: |
| 90 | + pattern: "*-artifacts" |
32 | 91 | path: dist |
| 92 | + merge-multiple: true # puts all files under dist/ |
33 | 93 |
|
34 | 94 | - name: Create GitHub Release |
35 | 95 | uses: softprops/action-gh-release@v2 |
|
0 commit comments