Commit | Line | Data |
---|---|---|
4c7e68aa | 1 | name: Release Please |
11caf266 APA |
2 | |
3 | on: | |
4c7e68aa JB |
4 | push: |
5 | branches: | |
6 | - master | |
7 | ||
8 | permissions: | |
9 | contents: read | |
11caf266 APA |
10 | |
11 | jobs: | |
4c7e68aa JB |
12 | release-please: |
13 | runs-on: ubuntu-latest | |
14 | ||
15 | permissions: | |
16 | contents: write | |
17 | pull-requests: write | |
18 | ||
19 | outputs: | |
20 | release_created: ${{ steps.release.outputs.release_created }} | |
21 | ||
22 | steps: | |
23 | - uses: googleapis/release-please-action@v4 | |
24 | id: release | |
25 | with: | |
26 | token: ${{ secrets.WORKFLOW_TOKEN }} | |
27 | config-file: .github/release-please/config.json | |
28 | manifest-file: .github/release-please/manifest.json | |
29 | ||
30 | build-release: | |
31 | needs: release-please | |
11caf266 | 32 | runs-on: ubuntu-latest |
4c7e68aa | 33 | if: needs.release-please.outputs.release_created |
515e5da7 | 34 | |
11caf266 | 35 | steps: |
515e5da7 | 36 | - name: Checkout |
b358d1ac | 37 | uses: actions/checkout@v4 |
515e5da7 | 38 | |
4c156521 | 39 | - name: Setup pnpm |
c94835b4 | 40 | uses: pnpm/action-setup@v4 |
4c156521 | 41 | |
8ea47589 | 42 | - name: Setup Node.js |
6c527d3f | 43 | uses: actions/setup-node@v4 |
11caf266 | 44 | with: |
3d5424d5 | 45 | node-version: 20.x |
4c156521 | 46 | cache: 'pnpm' |
e0d233a8 | 47 | |
f1c674cd | 48 | - name: Install Dependencies |
c1a37d98 | 49 | run: pnpm install --ignore-scripts --frozen-lockfile |
e0d233a8 | 50 | |
4b85ba43 JB |
51 | - name: Tests & Coverage |
52 | run: | | |
4c156521 JB |
53 | pnpm test |
54 | pnpm coverage | |
11caf266 | 55 | |
73db65c0 | 56 | - name: Lint |
4c156521 | 57 | run: pnpm lint |
73db65c0 | 58 | |
4b85ba43 | 59 | - name: Production Build |
4c156521 | 60 | run: pnpm build:prod |
4b85ba43 | 61 | |
b7bb8586 | 62 | publish-jsr: |
4c7e68aa | 63 | needs: build-release |
b7bb8586 JB |
64 | runs-on: ubuntu-latest |
65 | ||
66 | permissions: | |
67 | contents: read | |
68 | id-token: write | |
69 | ||
70 | steps: | |
71 | - name: Checkout | |
72 | uses: actions/checkout@v4 | |
73 | ||
b7bb8586 JB |
74 | - name: Setup Node.js |
75 | uses: actions/setup-node@v4 | |
76 | with: | |
3d5424d5 | 77 | node-version: 20.x |
b7bb8586 JB |
78 | |
79 | - name: Read package.json version | |
80 | id: package-version | |
81 | uses: jaywcjlove/github-action-package@main | |
82 | ||
83 | - name: Publish Release | |
84 | if: ${{ contains(steps.package-version.outputs.version, '-') == false }} | |
ad60686d | 85 | run: npx jsr publish --allow-dirty |
b7bb8586 | 86 | |
cf523f68 | 87 | publish-npm: |
4c7e68aa | 88 | needs: build-release |
90bd5e47 | 89 | runs-on: ubuntu-latest |
90 | ||
91 | steps: | |
92 | - name: Checkout | |
b358d1ac | 93 | uses: actions/checkout@v4 |
90bd5e47 | 94 | |
4c156521 | 95 | - name: Setup pnpm |
c94835b4 | 96 | uses: pnpm/action-setup@v4 |
4c156521 | 97 | |
8ea47589 | 98 | - name: Setup Node.js |
6c527d3f | 99 | uses: actions/setup-node@v4 |
11caf266 | 100 | with: |
3d5424d5 | 101 | node-version: 20.x |
11caf266 | 102 | registry-url: https://registry.npmjs.org/ |
4c156521 | 103 | cache: 'pnpm' |
515e5da7 | 104 | |
f1c674cd | 105 | - name: Install Dependencies |
c1a37d98 | 106 | run: pnpm install --ignore-scripts --frozen-lockfile |
53e40a19 | 107 | |
5716dd56 | 108 | - name: Read package.json version |
5716dd56 | 109 | id: package-version |
8fddc4b9 | 110 | uses: jaywcjlove/github-action-package@main |
5716dd56 | 111 | |
5716dd56 S |
112 | - name: Publish Release |
113 | if: ${{ contains(steps.package-version.outputs.version, '-') == false }} | |
a454d573 | 114 | run: pnpm publish --no-git-checks |
11caf266 | 115 | env: |
74aeaae0 | 116 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
5716dd56 | 117 | |
17c90274 | 118 | - name: Publish Pre-Release |
04805b54 | 119 | if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }} |
a454d573 | 120 | run: pnpm publish --no-git-checks --tag next |
5716dd56 | 121 | env: |
74aeaae0 | 122 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
17c90274 | 123 | |
8ea47589 JB |
124 | - name: Publish Beta Release |
125 | if: ${{ contains(steps.package-version.outputs.version, '-beta') == true }} | |
126 | run: pnpm publish --no-git-checks --tag beta | |
127 | env: | |
128 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |