-
Notifications
You must be signed in to change notification settings - Fork 45
158 lines (154 loc) · 4.22 KB
/
release.yml
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
name: release
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
arch: x64
node: 18
- os: windows-latest
arch: arm64
node: 20
- os: windows-latest
arch: ia32
node: 16
- os: macos-latest
arch: x64
node: 18
- os: macos-latest
arch: arm64
node: 18
- os: ubuntu-latest
arch: x64
libc: glibc
image: ghcr.io/prebuild/almalinux-devtoolset11:2.3.1
node: 18
- os: ubuntu-latest
arch: x64
libc: musl
image: ghcr.io/prebuild/alpine:2.1.1
node: 18
- os: ubuntu-latest
arch: arm64
libc: glibc
image: ghcr.io/prebuild/linux-arm64-lts:2.1.1
node: 18
- os: ubuntu-latest
arch: arm64
libc: musl
image: ghcr.io/prebuild/linux-arm64-musl:2.1.1
node: 18
- os: ubuntu-latest
arch: arm
libc: glibc
image: ghcr.io/prebuild/linux-armv7:2.1.1
node: 18
- os: ubuntu-latest
arch: arm
libc: musl
image: ghcr.io/prebuild/linux-armv7l-musl:2.3.1
node: 18
- os: ubuntu-latest
arch: arm64
image: ghcr.io/prebuild/android-arm64:2.1.1
node: 18
runs-on: ${{matrix.os}}
container:
image: ${{matrix.image}}
options: -u root
steps:
- run: microdnf install git -y
if: ${{ matrix.arch == 'x64' && matrix.libc == 'glibc' }}
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{matrix.node}}
- run: yarn --frozen-lockfile --ignore-scripts
- run: npm install node-gyp -g
- run: yarn prebuild --arch ${{ matrix.arch }} -t ${{ matrix.node }}.0.0
env:
PREBUILD_LIBC: ${{ matrix.libc }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: prebuilds
path: prebuilds
build-freebsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build FreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y -f curl node libnghttp2 npm yarn
echo "~~~~ node -v ~~~~"
node -v
echo "~~~~ yarn --version ~~~~"
yarn --version
run: |
yarn --frozen-lockfile --ignore-scripts
npm install node-gyp -g
yarn prebuild --arch x64 -t 18.0.0
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: prebuilds
path: prebuilds
build-wasm:
runs-on: ubuntu-latest
container:
image: emscripten/emsdk
steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 18
- run: yarn --frozen-lockfile
- run: make wasm
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wasm
path: build/Release/watcher.wasm
release:
runs-on: ubuntu-latest
needs:
- build
- build-freebsd
- build-wasm
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 18
- run: yarn --frozen-lockfile --ignore-scripts
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Build npm packages
run: |
node scripts/build-npm.js
node scripts/build-wasm.js
- name: Publish to npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc
for pkg in npm/*; do
echo "Publishing $pkg..."
cd $pkg;
npm publish;
cd ../..;
done