Repository navigation
96 lines (91 loc) · 2.81 KB
/
Copy pathrelease.yml
File metadata and controls
96 lines (91 loc) · 2.81 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
name: Release
on:
push:
tags: ['v*']
permissions:
contents: read
jobs:
validate:
uses: ./.github/workflows/ci.yml
build:
needs: validate
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
args: --mac dmg zip --universal
onnx: darwin
# node-gyp 9.4.1 cannot detect Visual Studio 2026 on windows-latest.
- os: windows-2022
args: --win nsis --x64 --arm64
onnx: win32
- os: ubuntu-latest
args: --linux AppImage --x64
onnx: linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
# node-gyp 9.4.1 requires distutils, removed in Python 3.12+.
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: npm ci
- run: npm run typecheck
- run: npm run build
- name: Prune onnxruntime to target platform
run: node scripts/prune-onnxruntime.mjs ${{ matrix.onnx }}
- name: Drop optional ws natives
# bufferutil and utf-8-validate are optional speed-ups for `ws`.
# They have no Electron prebuild here, so electron-builder rebuilds
# them with node-gyp: macOS runners (Python 3.12) lack distutils, and
# windows-latest has no Visual Studio that this node-gyp can find.
# `ws` falls back to pure JS. Removing them lets the installer publish.
run: node -e "const fs=require('fs'); for (const p of ['node_modules/bufferutil','node_modules/utf-8-validate']) fs.rmSync(p,{recursive:true,force:true})"
- name: Build installers
run: npx electron-builder ${{ matrix.args }} --publish never
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: |
dist/*.dmg
dist/*.zip
dist/*.exe
dist/*.AppImage
dist/latest*.yml
dist/*.blockmap
if-no-files-found: error
publish:
needs: [validate, build]
permissions:
contents: write
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: dist-*
merge-multiple: true
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.dmg
dist/*.zip
dist/*.exe
dist/*.AppImage
dist/latest*.yml
dist/*.blockmap
generate_release_notes: true
prerelease: false
make_latest: true
draft: false