-
-
Notifications
You must be signed in to change notification settings - Fork 167
80 lines (69 loc) · 2.24 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
name: Build & publish binary node
on:
release:
types: [published]
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
host:
- x64
target:
- x64
node:
- 18
include:
- os: windows-latest
node: 18
host: x86
target: x86
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
with:
msbuild-architecture: ${{ matrix.target }}
- name: Setup node (node=${{ matrix.node }}, host=${{ matrix.host }})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.host }}
- name: Install dependencies
run: npm install --ignore-scripts
- name: Add env vars
shell: bash
run: |
echo "V=1" >> $GITHUB_ENV
if [ "${{ matrix.target }}" = "x86" ]; then
echo "TARGET=ia32" >> $GITHUB_ENV
else
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
fi
- name: Configure build
run: ./node_modules/.bin/node-pre-gyp configure --target_arch=${{ env.TARGET }}
- name: Build binaries
run: ./node_modules/.bin/node-pre-gyp build --target_arch=${{ env.TARGET }}
- name: Package prebuilt binaries
run: ./node_modules/.bin/node-pre-gyp package --target_arch=${{ env.TARGET }}
# Run only for matrix.node 18
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v3
if: matrix.node == 18
with:
name: prebuilt-binaries
path: build/stage/*/*
retention-days: 7
# Run only for matrix.node 18
- name: Upload binaries to GitHub Release
run: ./node_modules/.bin/node-pre-gyp-github publish
if: matrix.node == 18 && startsWith(github.ref, 'refs/tags/')
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ github.token }}