build: switch to pnpm
[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 Node
16 uses: actions/setup-node@v3
17 with:
18 node-version: '18.x'
19
20 - name: Install
21 run: |
22 corepack enable
23 pnpm install
24
25 - name: Tests & Coverage
26 run: |
27 pnpm run test
28 pnpm run coverage
29
30 - name: Lint
31 run: pnpm run lint
32
33 - name: Production Build
34 run: pnpm run build:prod
35
36 publish:
37 needs: build
38 runs-on: ubuntu-latest
39
40 steps:
41 - name: Checkout
42 uses: actions/checkout@v3
43
44 - name: Setup Node
45 uses: actions/setup-node@v3
46 with:
47 node-version: '18.x'
48 registry-url: https://registry.npmjs.org/
49
50 - name: Read package.json version
51 id: package-version
52 uses: jaywcjlove/github-action-package@main
53
54 - name: Install
55 run: pnpm install
56
57 - name: Publish Release
58 if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
59 run: pnpm publish
60 env:
61 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62
63 - name: Publish Pre-Release
64 if: ${{ contains(steps.package-version.outputs.version, '-') == true }}
65 run: pnpm publish --tag next
66 env:
67 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
68
69 # - name: Publish Beta Release
70 # if: ${{ contains(steps.package-version.outputs.version, 'beta') == true }}
71 # run: pnpm publish --tag beta
72 # env:
73 # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}