forked from nospaceships/node-raw-socket
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (70 loc) · 2.34 KB
/
deploy.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
name: Automated deploy
on:
release:
types: [created]
# testing purpose
pull_request:
branches:
- '**'
env:
VERSION: ${{ github.event.release.tag_name }}
TARGET_REF: ${{ github.event.release.target_commitish }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: darwin
os: macos-11
node_arch: x64
command: prebuildify
args: --arch x64+arm64
- name: win32-x86
os: windows-2019
node_arch: x86
command: prebuildify
- name: win32-x64
os: windows-2019
node_arch: x64
command: prebuildify
- name: linux-x64
os: ubuntu-latest
command: prebuildify-cross
args: -i centos7-devtoolset7 -i alpine
- name: linux-arm
os: ubuntu-latest
command: prebuildify-cross
args: -i linux-arm64-lts -i linux-armv7 -i linux-armv6
- name: android-arm
os: ubuntu-latest
command: prebuildify-cross
args: -i android-arm64 -i android-armv7
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.TARGET_REF }}
token: ${{ secrets.GPR_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18
architecture: ${{ matrix.node_arch }}
# https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md#windows
- name: Update node-gyp (windows)
shell: pwsh
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
# Find the location of node.exe
$nodeExeLocation = Get-Command node | Select-Object -ExpandProperty Source
# Extract the directory path from the node.exe location
$nodeDir = $nodeExeLocation | Split-Path
# Install node-gyp
npm i --prefix "$nodeDir\node_modules\npm\node_modules\npm-lifecycle" [email protected]
- name: Update node-gyp (non-windows)
if: ${{ !startsWith(matrix.os, 'windows') }}
run: npm explore npm/node_modules/npm-lifecycle -g -- npm install node-gyp@latest
- name: Install dependencies
run: npm ci
- name: Prebuild package
run: npm run ${{ matrix.command }} -- ${{ matrix.args }}