-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
201 lines (162 loc) · 6.06 KB
/
build.yml
File metadata and controls
201 lines (162 loc) · 6.06 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Build Electron App
on:
workflow_dispatch:
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install bundled FFmpeg binary
run: node node_modules/ffmpeg-static/install.js
- name: Verify bundled FFmpeg binary
run: |
node -e "const fs=require('node:fs'); const ffmpeg=require('ffmpeg-static'); if (typeof ffmpeg !== 'string' || !fs.existsSync(ffmpeg)) { throw new Error('Bundled ffmpeg-static binary is missing: ' + ffmpeg); } console.log('Using bundled ffmpeg binary: ' + ffmpeg);"
- name: Install app dependencies
run: npx electron-builder install-app-deps
- name: Build Windows app
shell: pwsh
run: |
npm run build:platform-native-helpers
npx tsc
npx vite build
npx electron-builder --win dir nsis --x64 --publish never
- name: Smoke test packaged Windows paths
run: npm run smoke:packaged-binaries
- name: Generate Windows artifact checksums
run: npm run checksums:release -- SHA256SUMS-windows.txt
- name: Attest Windows artifacts
uses: actions/attest@v4
with:
subject-checksums: release/SHA256SUMS-windows.txt
- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: windows-x64-release
path: |
release/*.exe
release/*.blockmap
release/latest*.yml
release/SHA256SUMS*.txt
if-no-files-found: error
retention-days: 30
build-macos:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: x64
arch_tag: darwin-x64
runner: macos-15-intel
- arch: arm64
arch_tag: darwin-arm64
runner: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install bundled FFmpeg binary
run: node node_modules/ffmpeg-static/install.js
- name: Verify bundled FFmpeg binary
run: |
node -e "const fs=require('node:fs'); const ffmpeg=require('ffmpeg-static'); if (typeof ffmpeg !== 'string' || !fs.existsSync(ffmpeg)) { throw new Error('Bundled ffmpeg-static binary is missing: ' + ffmpeg); } console.log('Using bundled ffmpeg binary: ' + ffmpeg);"
- name: Install app dependencies
run: npx electron-builder install-app-deps
- name: Build macOS app
run: |
npm run build:platform-native-helpers
npx tsc
npx vite build
npx electron-builder --mac dir dmg zip --${{ matrix.arch }} --publish never
- name: Smoke test packaged macOS paths
env:
PACKAGED_SMOKE_ARCH_TAGS: ${{ matrix.arch_tag }}
run: npm run smoke:packaged-binaries
- name: Generate macOS artifact checksums
run: npm run checksums:release -- SHA256SUMS-macos-${{ matrix.arch }}.txt
- name: Attest macOS artifacts
uses: actions/attest@v4
with:
subject-checksums: release/SHA256SUMS-macos-${{ matrix.arch }}.txt
- name: Upload macOS build
uses: actions/upload-artifact@v4
with:
name: macos-${{ matrix.arch }}-release
path: |
release/**/*.dmg
release/**/*.zip
release/**/*.blockmap
release/latest-mac.yml
release/SHA256SUMS*.txt
if-no-files-found: error
retention-days: 30
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install bundled FFmpeg binary
run: node node_modules/ffmpeg-static/install.js
- name: Verify bundled FFmpeg binary
run: |
node -e "const fs=require('node:fs'); const ffmpeg=require('ffmpeg-static'); if (typeof ffmpeg !== 'string' || !fs.existsSync(ffmpeg)) { throw new Error('Bundled ffmpeg-static binary is missing: ' + ffmpeg); } console.log('Using bundled ffmpeg binary: ' + ffmpeg);"
- name: Install Linux native build dependencies
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxt-dev libxtst-dev libxkbfile-dev libxi-dev libxrandr-dev libxinerama-dev
- name: Remove stale uiohook build output
run: rm -rf node_modules/uiohook-napi/build
- name: Install app dependencies
run: npx electron-builder install-app-deps
- name: Build Linux app
run: |
npm run build:platform-native-helpers
npx tsc
npx vite build
npx electron-builder --linux dir AppImage --x64 --publish never
- name: Smoke test packaged Linux paths
run: npm run smoke:packaged-binaries
- name: Generate Linux artifact checksums
run: npm run checksums:release -- SHA256SUMS-linux.txt
- name: Attest Linux artifacts
uses: actions/attest@v4
with:
subject-checksums: release/SHA256SUMS-linux.txt
- name: Upload Linux build
uses: actions/upload-artifact@v4
with:
name: linux-x64-release
path: |
release/**/*.AppImage
release/**/*.blockmap
release/latest-linux.yml
release/SHA256SUMS*.txt
if-no-files-found: error
retention-days: 30