test: add fixed priority queue get() test
[poolifier.git] / .github / workflows / publish-package.yml
1 name: Publish 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@v4
14
15 - name: Setup pnpm
16 uses: pnpm/action-setup@v4
17
18 - name: Setup Node.js
19 uses: actions/setup-node@v4
20 with:
21 node-version: 20.x
22 cache: 'pnpm'
23
24 - name: Install Dependencies
25 run: pnpm install --ignore-scripts --frozen-lockfile
26
27 - name: Tests & Coverage
28 run: |
29 pnpm test
30 pnpm coverage
31
32 - name: Lint
33 run: pnpm lint
34
35 - name: Production Build
36 run: pnpm build:prod
37
38 publish-jsr:
39 needs: build
40 runs-on: ubuntu-latest
41
42 permissions:
43 contents: read
44 id-token: write
45
46 steps:
47 - name: Checkout
48 uses: actions/checkout@v4
49
50 - name: Setup Node.js
51 uses: actions/setup-node@v4
52 with:
53 node-version: 20.x
54
55 - name: Read package.json version
56 id: package-version
57 uses: jaywcjlove/github-action-package@main
58
59 - name: Publish Release
60 if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
61 run: npx jsr publish --allow-dirty
62
63 publish-npm:
64 needs: build
65 runs-on: ubuntu-latest
66
67 steps:
68 - name: Checkout
69 uses: actions/checkout@v4
70
71 - name: Setup pnpm
72 uses: pnpm/action-setup@v4
73
74 - name: Setup Node.js
75 uses: actions/setup-node@v4
76 with:
77 node-version: 20.x
78 registry-url: https://registry.npmjs.org/
79 cache: 'pnpm'
80
81 - name: Install Dependencies
82 run: pnpm install --ignore-scripts --frozen-lockfile
83
84 - name: Read package.json version
85 id: package-version
86 uses: jaywcjlove/github-action-package@main
87
88 - name: Publish Release
89 if: ${{ contains(steps.package-version.outputs.version, '-') == false }}
90 run: pnpm publish --no-git-checks
91 env:
92 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
93
94 - name: Publish Pre-Release
95 if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }}
96 run: pnpm publish --no-git-checks --tag next
97 env:
98 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
99
100 - name: Publish Beta Release
101 if: ${{ contains(steps.package-version.outputs.version, '-beta') == true }}
102 run: pnpm publish --no-git-checks --tag beta
103 env:
104 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}