Skip to content

Commit 1969d96

Browse files
committed
Run github actions for windows, macos, linux
1 parent 33043f5 commit 1969d96

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,50 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-22.04
1413
strategy:
1514
matrix:
16-
node-version: [14.x, 16.x, 18.x]
15+
os: [ubuntu-20.04, macos-11.0, windows-2019]
16+
nodeVersion: [14, 16, 18, 20]
17+
runs-on: ${{ matrix.os }}
1718
steps:
18-
- uses: actions/checkout@v2
19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v1
19+
- uses: actions/checkout@v3
20+
- name: Use Node.js ${{ matrix.nodeVersion }}
21+
uses: actions/setup-node@v3
2122
with:
22-
node-version: ${{ matrix.node-version }}
23-
- name: Install dependencies
24-
run: |
25-
sudo apt-get install -y python3 make g++
23+
node-version: ${{ matrix.nodeVersion }}
2624
- name: Test
2725
run: npm test
26+
- name: Package
27+
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')
28+
run: npx node-pre-gyp package
29+
- name: Upload
30+
uses: actions/upload-artifact@v3
31+
if: matrix.nodeVersion == '14' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master'))
32+
with:
33+
name: bcrypt-lib-${{ matrix.os }}-${{ matrix.nodeVersion }}
34+
path: build/stage/**/bcrypt_lib*.tar.gz
2835

2936
build-alpine:
30-
runs-on: ubuntu-22.04
37+
runs-on: ubuntu-latest
3138
strategy:
3239
matrix:
33-
node-version: [14, 16, 18]
40+
nodeVersion: [14, 16, 18, 20]
3441
container:
35-
image: node:${{ matrix.node-version }}-alpine
42+
image: node:${{ matrix.nodeVersion }}-alpine
3643
steps:
37-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v3
3845
- name: Install dependencies
3946
run: |
4047
apk add make g++ python3
4148
- name: Test
4249
run: |
4350
npm test --unsafe-perm
51+
- name: Package
52+
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')
53+
run: npx node-pre-gyp package --unsafe-perm
54+
- name: Upload
55+
if: matrix.nodeVersion == '14' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master'))
56+
uses: actions/upload-artifact@v3
57+
with:
58+
name: bcrypt-lib-alpine-${{ matrix.nodeVersion }}
59+
path: build/stage/**/bcrypt_lib*.tar.gz

0 commit comments

Comments
 (0)