Skip to content

Commit 6c2cda3

Browse files
authored
Refactor release workflow for multi-OS support
Updated GitHub Actions workflow to improve release process and added support for multiple OS builds.
1 parent 4704223 commit 6c2cda3

1 file changed

Lines changed: 68 additions & 8 deletions

File tree

.github/workflows/main.yml

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,79 @@
1-
name: Create Release
1+
name: Release on Tag
22

33
on:
44
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
714

815
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+
970
release:
71+
needs: build
1072
runs-on: ubuntu-latest
11-
needs: [ ] # set to ["build"] if you keep both jobs in one workflow file
1273
steps:
1374
- uses: actions/checkout@v4
75+
with: { fetch-depth: 0 }
1476

15-
# (Optional) Generate changelog via Conventional Commits
16-
# - uses: googleapis/release-please-action@v4
17-
# with: ...
18-
# If you prefer a quick native notes:
1977
- name: Generate release notes
2078
id: notes
2179
uses: actions/github-script@v7
@@ -29,7 +87,9 @@ jobs:
2987
- name: Download all artifacts
3088
uses: actions/download-artifact@v4
3189
with:
90+
pattern: "*-artifacts"
3291
path: dist
92+
merge-multiple: true # puts all files under dist/
3393

3494
- name: Create GitHub Release
3595
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)