forked from louislam/node-sqlite3
-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (81 loc) · 2.41 KB
/
Copy pathwinmac.yml
File metadata and controls
93 lines (81 loc) · 2.41 KB
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
name: winmac
on:
workflow_dispatch:
env:
FORCE_COLOR: 1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
host:
- x64
target:
- x64
node:
- 16
include:
- os: windows-latest
node: 16
host: x86
target: x86
- os: macos-m1
node: 16
host: arm64
target: arm64
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.host }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.target }}
- 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: update npm
run: npm install npm@8.6.x -g
- name: update npm
run: npm install -g node-gyp@8.4.x
- name: install
run: npm install @mapbox/node-pre-gyp@1.0.9 -g
- name: install github
run: npm install node-pre-gyp-github -g
- name: npm-install
run: npm install --ignore-scripts
- name: Configure build
run: node-pre-gyp configure --target_arch=${{ env.TARGET }}
- name: Build binaries
run: node-pre-gyp build --target_arch=${{ env.TARGET }}
- name: Package prebuilt binaries
run: node-pre-gyp package --target_arch=${{ env.TARGET }}
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v3
if: matrix.node == 16
with:
name: prebuilt-binaries
path: build/stage/*/*
retention-days: 7
- name: Upload binaries to GitHub Release
run: node-pre-gyp-github publish
if: matrix.node == 16
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.API_TOKEN }}