README.md: fix link to dependabot badge
[poolifier.git] / .github / workflows / npmpublish.yml
CommitLineData
11caf266
APA
1name: Node.js Package
2
3on:
4 release:
5 types: [created]
6
7jobs:
8 build:
9 runs-on: ubuntu-latest
515e5da7 10
11caf266 11 steps:
515e5da7 12 - name: Checkout
b8497a0a 13 uses: actions/checkout@v3
515e5da7
APA
14
15 - name: Setup Node
b8497a0a 16 uses: actions/setup-node@v3
11caf266 17 with:
4f4ae1cb 18 node-version: '16.x'
e0d233a8
JB
19
20 - name: Install
21 run: npm ci
22
23 - name: Production Build
24 run: npm run build:prod
25
26 - name: Lint
27 run: npm run lint
28
fe748efa
JB
29 # - name: Production Tests & Coverage
30 # run: |
31 # npm run test:prod
32 # npm run coverage
e0d233a8
JB
33 env:
34 CI: true
11caf266 35
90bd5e47 36 publish-npm:
37 needs: build
38 runs-on: ubuntu-latest
39
40 steps:
41 - name: Checkout
b8497a0a 42 uses: actions/checkout@v3
90bd5e47 43
515e5da7 44 - name: Setup Node
b8497a0a 45 uses: actions/setup-node@v3
11caf266 46 with:
4f4ae1cb 47 node-version: '16.x'
11caf266 48 registry-url: https://registry.npmjs.org/
515e5da7 49
5716dd56
S
50 - name: Read package.json version
51 uses: tyankatsu0105/read-package-version-actions@v1
52 id: package-version
53
515e5da7 54 - name: Install
90bd5e47 55 run: npm ci
56
5716dd56
S
57 - name: Publish Release
58 if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
4f4ae1cb 59 run: npm publish
11caf266 60 env:
74aeaae0 61 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5716dd56
S
62
63 - name: Publish Beta
64 if: ${{ contains(steps.package-version.outputs.version, 'beta') }}
65 run: npm publish --tag beta
66 env:
74aeaae0 67 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}