build(deps-dev): bump @types/node
[poolifier.git] / .github / workflows / npmpublish.yml
1 name: Node.js Package
2
3 on:
4 release:
5 types: [created]
6
7 jobs:
8 build:
9 runs-on: ubuntu-latest
10
11 steps:
12 - name: Checkout
13 uses: actions/checkout@v3
14
15 - name: Setup pnpm
16 uses: pnpm/action-setup@v2
17 with:
18 version: 8
19
20 - name: Setup Node.js
21 uses: actions/setup-node@v3
22 with:
23 node-version: '18.x'
24 cache: 'pnpm'
25
26 - name: Install
27 run: pnpm install
28
29 - name: Tests & Coverage
30 run: |
31 pnpm test
32 pnpm coverage
33
34 - name: Lint
35 run: pnpm lint
36
37 - name: Production Build
38 run: pnpm build:prod
39
40 publish:
41 needs: build
42 runs-on: ubuntu-latest
43
44 steps:
45 - name: Checkout
46 uses: actions/checkout@v3
47
48 - name: Setup pnpm
49 uses: pnpm/action-setup@v2
50 with:
51 version: 8
52
53 - name: Setup Node.js
54 uses: actions/setup-node@v3
55 with:
56 node-version: '18.x'
57 registry-url: https://registry.npmjs.org/
58 cache: 'pnpm'
59
60 - name: Read package.json version
61 id: package-version
62 uses: jaywcjlove/github-action-package@main
63
64 - name: Install
65 run: pnpm install
66
67 - name: Publish Release
68 if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
69 run: pnpm publish --no-git-checks
70 env:
71 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72
73 - name: Publish Pre-Release
74 if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }}
75 run: pnpm publish --no-git-checks --tag next
76 env:
77 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
78
79 - name: Publish Beta Release
80 if: ${{ contains(steps.package-version.outputs.version, '-beta') == true }}
81 run: pnpm publish --no-git-checks --tag beta
82 env:
83 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}