-
-
Notifications
You must be signed in to change notification settings - Fork 110
47 lines (46 loc) · 1.11 KB
/
build.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
name: Build and publish
on:
pull_request:
types:
- opened
push:
branches:
- develop
- development
- alpha
- beta
- master
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
- run: npm run build
- run: tar -czvf distrib-${{ matrix.node }}.tar.gz modbus examples extras package.json docs index.js README.md CHANGELOG.md
- uses: actions/upload-artifact@v4
with:
name: build-artifact-${{ matrix.node }}
path: distrib-${{ matrix.node }}.tar.gz
publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm test
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}