forked from nospaceships/node-raw-socket
-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (101 loc) · 2.92 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Automated deploy
on:
release:
types: [created]
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:
- os: macos-12
label: x64+arm64
node_arch: x64
command: build:gyp
args: --arch x64+arm64
- os: windows-2019
label: x86
node_arch: x86
command: build:gyp
- os: windows-2019
label: x64
node_arch: x64
command: build:gyp
- os: ubuntu-20.04
label: alpine
command: build:gyp-cross
args: -i centos7-devtoolset7 -i alpine
- os: ubuntu-20.04
label: armv6+armv7
command: build:gyp-cross
args: -i linux-arm64-lts -i linux-armv7 -i linux-armv6
- os: ubuntu-20.04
label: musl+arm64-musl
command: build:gyp-cross
args: --tag-libc musl -i linux-arm64-musl
- os: ubuntu-20.04
label: arm64+armv7
command: build:gyp-cross
args: -i android-arm64 -i android-armv7
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TARGET_REF }}
token: ${{ secrets.GPR_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 22
architecture: ${{ matrix.node_arch }}
- name: Install dependencies
run: npm ci
- name: Prebuild package
run: npm run ${{ matrix.command }} -- ${{ matrix.args }}
- uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ matrix.os }}-${{ matrix.label }}
path: prebuilds/
if-no-files-found: error
merge:
runs-on: ubuntu-latest
needs: build
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: build-artifacts
pattern: build-artifacts-*
deploy:
needs: merge
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.TARGET_REF }}
token: ${{ secrets.GPR_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v4
with:
name: build-artifacts
path: prebuilds
- name: Install dependencies
run: npm ci
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://npm.pkg.github.com'
scope: '@NeuraLegion'
- name: Publish to GPR
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }}