-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (72 loc) · 2.22 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (72 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Install app dependencies
working-directory: app
run: npm ci
- name: Run tests
run: |
npm --prefix frontend test
npm --prefix app test
# Build only — no publish here. Three parallel jobs each trying to
# create/find the same GitHub release is a known electron-builder race:
# only one reliably wins, and the others can exit 0 while silently
# skipping their own upload. Publishing happens once, sequentially,
# in the job below instead.
- name: Build
working-directory: app
run: npm run build:all && npx electron-builder --publish never
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: |
app/release/*.exe
app/release/*.exe.blockmap
app/release/*.dmg
app/release/*.dmg.blockmap
app/release/*.zip
app/release/*.AppImage
app/release/latest*.yml
if-no-files-found: ignore
publish-release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: List downloaded assets
run: ls -la dist
- name: Publish release with all platform assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" dist/* \
--repo "${{ github.repository }}" \
--title "${{ github.ref_name }}" \
--generate-notes \
--draft=false \
|| gh release upload "${{ github.ref_name }}" dist/* \
--repo "${{ github.repository }}" \
--clobber