-
Notifications
You must be signed in to change notification settings - Fork 170
95 lines (91 loc) · 3.45 KB
/
build.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
name: Build
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review Push'
uses: actions/dependency-review-action@v3
if: ${{ github.event_name == 'push'}}
with:
fail-on-severity: moderate
base-ref: ${{ github.event.before }}
head-ref: ${{ github.sha }}
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
if: ${{ github.event_name != 'push'}}
with:
fail-on-severity: moderate
build-node-publish:
needs: dependency-review
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
node: [13.14.0, 14.0.0, 15.7.0, 16.13.1, 17.6.0, 18.8.0, 19.0.0]
architecture: [x64, ia32, arm64]
include:
- python_version: "3.10"
- architecture: ia32
architecture_node: x86
target_architecture: ia32
- architecture: x64
architecture_node: x64
target_architecture: x64
- architecture: arm64
architecture_node: x64
target_architecture: arm64
extra_compile_flags: -arch arm64
EXTRA_NODE_PRE_GYP_FLAGS: --target_arch=arm64
exclude:
- os: ubuntu-20.04
architecture: arm64
- os: windows-2019
architecture: arm64
- os: macos-11
architecture: ia32
- os: ubuntu-20.04
architecture: ia32
- os: macos-11
node: 13.14.0
architecture: arm64
- os: macos-11
node: 14.0.0
architecture: arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.architecture_node }}
- run: node --version
- run: npm --version
- run: npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe"
if: ${{ runner.os == 'Windows' }}
- run: npm install --build-from-source
env:
npm_config_arch: ${{ matrix.architecture }}
npm_config_python: python${{ matrix.python_version }}
npm_config_target_arch: ${{ matrix.target_architecture }}
CFLAGS: ${{ matrix.extra_compile_flags }}
CPPFLAGS: ${{ matrix.extra_compile_flags }}
- run: npm test
if: ${{ matrix.target_architecture != 'arm64' }}
- run: ./node_modules/.bin/node-pre-gyp package testpackage --target_arch=${{ matrix.target_architecture }}
if: ${{ matrix.target_architecture != 'arm64' }}
- run: ./node_modules/.bin/node-pre-gyp package --target_arch=${{ matrix.target_architecture }}
if: ${{ matrix.target_architecture == 'arm64' }}
- run: ./node_modules/.bin/node-pre-gyp unpublish publish --target_arch=${{ matrix.target_architecture }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[publish binary]')}}
env:
AWS_ACCESS_KEY_ID: ${{secrets.NODE_PRE_GYP_ACCESSKEYID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.NODE_PRE_GYP_SECRETACCESSKEY}}