-
Notifications
You must be signed in to change notification settings - Fork 5
82 lines (69 loc) · 2.2 KB
/
npm-publish.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
name: Build @cryptlex/lexactivator package
on:
workflow_dispatch:
jobs:
# Link LexActivator static libs to Node
build-addons:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, windows-2019]
steps:
- uses: actions/checkout@v2
- run: git pull origin master --ff-only
- uses: actions/setup-node@v1
with:
node-version: 10
# - name: Install Windows 2015 build tools
# if: matrix.os == 'windows-2019'
# run: npm i --global windows-build-tools --vs2015
- name: Build for Windows
if: matrix.os == 'windows-2019'
shell: powershell
run: |
npm i -g node-gyp@8
.\scripts\build-windows.ps1
- name: Build for macOS
if: matrix.os == 'macos-13'
run: |
npm i -g node-gyp@8
./scripts/build-macos.sh
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
run: |
docker run -t -v $PWD:$PWD -w $PWD cryptlex/gcc-4.9:1 ./scripts/build-linux.sh
docker run -t -v $PWD:$PWD -w $PWD cryptlex/gcc-4.9-arm:1 ./scripts/build-linux-arm.sh
docker run -t -v $PWD:$PWD -w $PWD cryptlex/alpine-builder:2 ./scripts/build-linux-musl.sh
- name: 'Upload artifacts'
uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
./lib/bindings/linux/**/**/*.node
./lib/bindings/macos/**/*.node
./lib/bindings/windows/**/*.node
./lib/bindings/windows/**/*.dll
retention-days: 1
# Publish to NPM
publish-npm:
needs: build-addons
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: git pull origin master --ff-only
- name: 'Download artifacts'
uses: actions/download-artifact@v2
with:
path: ./lib/bindings
name: artifacts
- name: 'Build library'
run: |
npm ci
npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}