-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (51 loc) · 1.38 KB
/
ci.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
name: CI
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node-version: [16, 18, 20, 22]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Set macOS system controls
if: runner.os == 'macOS'
run: |
sudo sysctl -w kern.sysv.shmall=65536
sudo sysctl -w kern.sysv.shmmax=16777216
- name: Setup build tools
run: |
npm install -g node-gyp
npm install -g node-pre-gyp-github
- name: Set publish flag
run: |
echo "PUBLISH_BINARY=false" >> $GITHUB_ENV
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
echo "PUBLISH_BINARY=true" >> $GITHUB_ENV
fi
if [[ "${{ github.event.head_commit.message }}" == *"[publish binary]"* ]]; then
echo "PUBLISH_BINARY=true" >> $GITHUB_ENV
fi
- name: Setup Linux compiler
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++
echo "CXX=g++" >> $GITHUB_ENV
- name: Install dependencies
run: npm install
- name: Build
run: npm run build