forked from node-ffi-napi/node-ffi-napi
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (75 loc) · 1.97 KB
/
release.yml
File metadata and controls
93 lines (75 loc) · 1.97 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: Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
prebuild:
name: Prebuild on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x64
- os: windows-latest
arch: x64
- os: windows-latest
arch: x86
- os: macos-latest
arch: x64
- os: macos-15-intel
arch: x64
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22.x'
architecture: ${{ matrix.arch }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build native tests
run: npm run build
- name: Run native tests
run: npm run test
- name: Prebuild
run: npm run prebuild
- name: Upload prebuilds
uses: actions/upload-artifact@v7
with:
name: node-ffi-napi-prebuild-${{ matrix.os }}-${{ matrix.arch }}
path: prebuilds/
publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: [prebuild]
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Download all prebuilds
uses: actions/download-artifact@v8
with:
path: prebuilds
merge-multiple: true
- run: ls -R prebuilds/
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}