-
-
Notifications
You must be signed in to change notification settings - Fork 220
85 lines (83 loc) · 2.24 KB
/
nodejs.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
name: NodeJS
on:
push:
tags:
- 'v*'
pull_request:
branches:
- master
jobs:
test:
strategy:
fail-fast: false
matrix:
#os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
node: [16, 18, 20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '>=1.17'
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install node-gyp
run: npm install -g node-gyp
- name: Build from source
run: |
cd bindings/js
npm --version
node --version
npm ci --build-from-source
npm test
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
#os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '>=1.17'
- uses: actions/setup-node@v4
- name: Install node-gyp and prebuildify
run: npm install --location=global node-gyp node-gyp-build node-api-headers prebuildify
- name: Install dependencies
run: |
cd bindings/js
npm install node-gyp-build node-api-headers
- name: Build
run: make -C bindings/js
- name: Test
run: |
cd bindings/js
npm test
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}.node
path: bindings/js/prebuilds/*/*.node
deploy:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
- name: Install node-gyp and prebuildify
run: npm install --location=global node-gyp node-gyp-build node-api-headers prebuildify
- uses: actions/download-artifact@v4
with:
path: bindings/js/prebuilds
- name: Move artifacts
run: cd bindings/js/prebuilds && mv */* .
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: make -C bindings/js publish