-
Notifications
You must be signed in to change notification settings - Fork 33
112 lines (109 loc) · 2.99 KB
/
ci.yml
File metadata and controls
112 lines (109 loc) · 2.99 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
name: CI
on:
- push
- pull_request
permissions: {}
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch:
- x64
- arm64
node:
- 20
- 22
- 24
os:
- macos-latest
- macos-15-intel
- ubuntu-latest
- windows-latest
exclude:
- arch: arm64
os: macos-15-intel
- arch: arm64
os: ubuntu-latest
- arch: arm64
os: windows-latest
- arch: x64
os: macos-latest
include:
- arch: x86
node: 20
os: windows-latest
- arch: x86
node: 22
os: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.arch }}
- run: npm install
- run: npm test
build:
if: startsWith(github.ref, 'refs/tags/')
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch:
- x64
os:
- macos-15-intel
- ubuntu-22.04
- windows-latest
include:
- arch: x86
os: windows-latest
- arch: arm64
os: macos-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
architecture: ${{ matrix.arch }}
- run: npm install
- run: npm run prebuild
- run: npm run prebuild-linux-musl-x64
if: matrix.os == 'ubuntu-22.04'
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: prebuilds
retention-days: 1
release:
needs: build
permissions:
contents: write # Needed for softprops/action-gh-release.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
path: prebuilds
- run: echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
id: get_version
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-darwin-x64.tar" -C
"prebuilds/macos-15-intel-x64" darwin-x64
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-darwin-arm64.tar"
-C "prebuilds/macos-latest-arm64" darwin-arm64
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-linux-x64.tar" -C
"prebuilds/ubuntu-22.04-x64" linux-x64
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-win32-ia32.tar" -C
"prebuilds/windows-latest-x86" win32-ia32
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-win32-x64.tar" -C
"prebuilds/windows-latest-x64" win32-x64
- uses: softprops/action-gh-release@v2
with:
files: ${{ steps.get_version.outputs.version }}-*.tar
token: ${{ secrets.GITHUB_TOKEN }}