|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | build: |
13 | | - runs-on: ubuntu-22.04 |
14 | 13 | strategy: |
15 | 14 | 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 }} |
17 | 18 | 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 |
21 | 22 | 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 }} |
26 | 24 | - name: Test |
27 | 25 | 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 |
28 | 35 |
|
29 | 36 | build-alpine: |
30 | | - runs-on: ubuntu-22.04 |
| 37 | + runs-on: ubuntu-latest |
31 | 38 | strategy: |
32 | 39 | matrix: |
33 | | - node-version: [14, 16, 18] |
| 40 | + nodeVersion: [14, 16, 18, 20] |
34 | 41 | container: |
35 | | - image: node:${{ matrix.node-version }}-alpine |
| 42 | + image: node:${{ matrix.nodeVersion }}-alpine |
36 | 43 | steps: |
37 | | - - uses: actions/checkout@v2 |
| 44 | + - uses: actions/checkout@v3 |
38 | 45 | - name: Install dependencies |
39 | 46 | run: | |
40 | 47 | apk add make g++ python3 |
41 | 48 | - name: Test |
42 | 49 | run: | |
43 | 50 | 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