forked from node-ffi-napi/node-ffi-napi
-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (139 loc) · 3.88 KB
/
ci.yml
File metadata and controls
145 lines (139 loc) · 3.88 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: run tests
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
setup-node_modules:
runs-on:
- ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: pnpm/action-setup@v3.0.0
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: "nick-fields/retry@v2.9.0"
with:
max_attempts: 10
timeout_minutes: 15
retry_on: error
command: pnpm fetch --ignore-scripts
ci-tests:
needs: setup-node_modules
runs-on:
- ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
node-version: [18, 20]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: pnpm/action-setup@v3.0.0
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: pnpm install
uses: nick-fields/retry@v2.9.0
with:
max_attempts: 10
timeout_minutes: 15
retry_on: error
command: pnpm install --frozen-lockfile
- name: Run test suite
run: pnpm test
ci-build:
needs: ci-tests
runs-on:
- ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: pnpm/action-setup@v3.0.0
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: pnpm install
uses: nick-fields/retry@v2.9.0
with:
max_attempts: 10
timeout_minutes: 15
retry_on: error
command: pnpm install --frozen-lockfile
- name: prebuild
run: |
pnpm prebuild --v8_enable_pointer_compression=false --v8_enable_31bit_smis_on_64bit_arch=false
- name: Upload
uses: actions/upload-artifact@v4
with:
name: binary-${{ runner.os }}
path: prebuilds
release:
name: Release
needs: ci-build
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3.0.0
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: pnpm install
uses: nick-fields/retry@v2.9.0
with:
max_attempts: 10
timeout_minutes: 15
retry_on: error
command: pnpm install --frozen-lockfile
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: prebuilds
pattern: binary-*
merge-multiple: true
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
zip -r prebuilds.zip prebuilds
pnpm semantic-release