Commit | Line | Data |
---|---|---|
b7bb8586 | 1 | name: Publish package |
11caf266 APA |
2 | |
3 | on: | |
4 | release: | |
5 | types: [created] | |
6 | ||
7 | jobs: | |
8 | build: | |
9 | runs-on: ubuntu-latest | |
515e5da7 | 10 | |
11caf266 | 11 | steps: |
515e5da7 | 12 | - name: Checkout |
b358d1ac | 13 | uses: actions/checkout@v4 |
515e5da7 | 14 | |
4c156521 | 15 | - name: Setup pnpm |
c94835b4 | 16 | uses: pnpm/action-setup@v4 |
4c156521 | 17 | |
8ea47589 | 18 | - name: Setup Node.js |
6c527d3f | 19 | uses: actions/setup-node@v4 |
11caf266 | 20 | with: |
3d5424d5 | 21 | node-version: 20.x |
4c156521 | 22 | cache: 'pnpm' |
e0d233a8 | 23 | |
f1c674cd | 24 | - name: Install Dependencies |
c1a37d98 | 25 | run: pnpm install --ignore-scripts --frozen-lockfile |
e0d233a8 | 26 | |
4b85ba43 JB |
27 | - name: Tests & Coverage |
28 | run: | | |
4c156521 JB |
29 | pnpm test |
30 | pnpm coverage | |
11caf266 | 31 | |
73db65c0 | 32 | - name: Lint |
4c156521 | 33 | run: pnpm lint |
73db65c0 | 34 | |
4b85ba43 | 35 | - name: Production Build |
4c156521 | 36 | run: pnpm build:prod |
4b85ba43 | 37 | |
b7bb8586 JB |
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 | ||
b7bb8586 JB |
50 | - name: Setup Node.js |
51 | uses: actions/setup-node@v4 | |
52 | with: | |
3d5424d5 | 53 | node-version: 20.x |
b7bb8586 JB |
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 }} | |
ad60686d | 61 | run: npx jsr publish --allow-dirty |
b7bb8586 | 62 | |
cf523f68 | 63 | publish-npm: |
90bd5e47 | 64 | needs: build |
65 | runs-on: ubuntu-latest | |
66 | ||
67 | steps: | |
68 | - name: Checkout | |
b358d1ac | 69 | uses: actions/checkout@v4 |
90bd5e47 | 70 | |
4c156521 | 71 | - name: Setup pnpm |
c94835b4 | 72 | uses: pnpm/action-setup@v4 |
4c156521 | 73 | |
8ea47589 | 74 | - name: Setup Node.js |
6c527d3f | 75 | uses: actions/setup-node@v4 |
11caf266 | 76 | with: |
3d5424d5 | 77 | node-version: 20.x |
11caf266 | 78 | registry-url: https://registry.npmjs.org/ |
4c156521 | 79 | cache: 'pnpm' |
515e5da7 | 80 | |
f1c674cd | 81 | - name: Install Dependencies |
c1a37d98 | 82 | run: pnpm install --ignore-scripts --frozen-lockfile |
53e40a19 | 83 | |
5716dd56 | 84 | - name: Read package.json version |
5716dd56 | 85 | id: package-version |
8fddc4b9 | 86 | uses: jaywcjlove/github-action-package@main |
5716dd56 | 87 | |
5716dd56 S |
88 | - name: Publish Release |
89 | if: ${{ contains(steps.package-version.outputs.version, '-') == false }} | |
a454d573 | 90 | run: pnpm publish --no-git-checks |
11caf266 | 91 | env: |
74aeaae0 | 92 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
5716dd56 | 93 | |
17c90274 | 94 | - name: Publish Pre-Release |
04805b54 | 95 | if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }} |
a454d573 | 96 | run: pnpm publish --no-git-checks --tag next |
5716dd56 | 97 | env: |
74aeaae0 | 98 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
17c90274 | 99 | |
8ea47589 JB |
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 }} |