@@ -9,19 +9,51 @@ permissions:
99 contents : write
1010
1111jobs :
12- release :
13- name : Build & Release
14- strategy :
15- fail-fast : false
16- matrix :
17- include :
18- - os : windows-latest
19- artifact : ' *.exe'
20- - os : macos-latest
21- artifact : ' *.dmg'
22- runs-on : ${{ matrix.os }}
12+ release-windows :
13+ runs-on : windows-latest
14+ env :
15+ CSC_LINK : ${{ secrets.CSC_LINK }}
16+ CSC_KEY_PASSWORD : ${{ secrets.CSC_KEY_PASSWORD }}
2317 steps :
2418 - uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 0
21+ - uses : pnpm/action-setup@v4
22+ with :
23+ version : 9
24+ - uses : actions/setup-node@v4
25+ with :
26+ node-version : 22
27+ cache : pnpm
28+ - run : pnpm install --frozen-lockfile
29+ - run : pnpm run build
30+ - run : pnpm run package
31+ - name : Generate checksums
32+ shell : pwsh
33+ run : |
34+ Get-ChildItem -Path release -Recurse -Include *.exe | ForEach-Object {
35+ $hash = (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower()
36+ "$hash $($_.Name)" | Out-File -Append -FilePath release/checksums-windows.txt
37+ }
38+ - uses : actions/upload-artifact@v4
39+ with :
40+ name : windows-release
41+ path : |
42+ release/**/*.exe
43+ release/checksums-windows.txt
44+
45+ release-macos :
46+ runs-on : macos-latest
47+ env :
48+ CSC_LINK : ${{ secrets.CSC_LINK }}
49+ CSC_KEY_PASSWORD : ${{ secrets.CSC_KEY_PASSWORD }}
50+ APPLE_ID : ${{ secrets.APPLE_ID }}
51+ APPLE_APP_SPECIFIC_PASSWORD : ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
52+ APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
53+ steps :
54+ - uses : actions/checkout@v4
55+ with :
56+ fetch-depth : 0
2557 - uses : pnpm/action-setup@v4
2658 with :
2759 version : 9
@@ -30,20 +62,66 @@ jobs:
3062 node-version : 22
3163 cache : pnpm
3264 - run : pnpm install --frozen-lockfile
33- - run : pnpm run typecheck
34- - run : pnpm run pretest
35- - run : pnpm run test
3665 - run : pnpm run build
37- - name : Package
38- run : pnpm run package
39- env :
40- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41- - name : Upload release assets
66+ - name : Package with optional notarization
67+ run : |
68+ if [ -n "$APPLE_ID" ] && [ -n "$APPLE_APP_SPECIFIC_PASSWORD" ] && [ -n "$APPLE_TEAM_ID" ]; then
69+ echo "Notarization secrets found, enabling notarize"
70+ npx json -I -f electron-builder.json -e 'this.mac.notarize=true'
71+ fi
72+ pnpm run package
73+ - name : Generate checksums
74+ run : |
75+ cd release
76+ find . -name "*.dmg" -o -name "*.zip" | while read f; do
77+ shasum -a 256 "$f" >> checksums-macos.txt
78+ done
79+ - uses : actions/upload-artifact@v4
80+ with :
81+ name : macos-release
82+ path : |
83+ release/**/*.dmg
84+ release/**/*.zip
85+ release/checksums-macos.txt
86+
87+ publish :
88+ runs-on : ubuntu-latest
89+ needs : [release-windows, release-macos]
90+ steps :
91+ - uses : actions/checkout@v4
92+ with :
93+ fetch-depth : 0
94+ - uses : actions/download-artifact@v4
95+ with :
96+ name : windows-release
97+ path : artifacts/windows
98+ - uses : actions/download-artifact@v4
99+ with :
100+ name : macos-release
101+ path : artifacts/macos
102+ - name : Generate changelog
103+ id : changelog
104+ run : |
105+ PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git rev-list --max-parents=0 HEAD)
106+ echo "## Changes" > changelog.md
107+ echo "" >> changelog.md
108+ git log --pretty=format:"- %s (%h)" "$PREV_TAG"..HEAD >> changelog.md
109+ echo "" >> changelog.md
110+ echo "" >> changelog.md
111+ echo "## Checksums" >> changelog.md
112+ echo '```' >> changelog.md
113+ cat artifacts/windows/checksums-windows.txt 2>/dev/null >> changelog.md || true
114+ cat artifacts/macos/checksums-macos.txt 2>/dev/null >> changelog.md || true
115+ echo '```' >> changelog.md
116+ - name : Create GitHub Release
42117 uses : softprops/action-gh-release@v2
43118 with :
119+ body_path : changelog.md
120+ draft : false
121+ prerelease : ${{ contains(github.ref, '-beta') || contains(github.ref, '-alpha') || contains(github.ref, '-rc') }}
44122 files : |
45- release /*.exe
46- release /*.dmg
47- release/*.AppImage
48- draft : true
49- generate_release_notes : true
123+ artifacts/windows/** /*.exe
124+ artifacts/macos/** /*.dmg
125+ artifacts/macos/**/*.zip
126+ artifacts/windows/checksums-windows.txt
127+ artifacts/macos/checksums-macos.txt
0 commit comments