Commit | Line | Data |
---|---|---|
f1c674cd | 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 |
2ca706c4 | 16 | uses: pnpm/action-setup@v3 |
4c156521 JB |
17 | with: |
18 | version: 8 | |
19 | ||
8ea47589 | 20 | - name: Setup Node.js |
6c527d3f | 21 | uses: actions/setup-node@v4 |
11caf266 | 22 | with: |
277c49bf | 23 | node-version: '20.x' |
4c156521 | 24 | cache: 'pnpm' |
e0d233a8 | 25 | |
f1c674cd | 26 | - name: Install Dependencies |
c1a37d98 | 27 | run: pnpm install --ignore-scripts --frozen-lockfile |
e0d233a8 | 28 | |
4b85ba43 JB |
29 | - name: Tests & Coverage |
30 | run: | | |
4c156521 JB |
31 | pnpm test |
32 | pnpm coverage | |
11caf266 | 33 | |
73db65c0 | 34 | - name: Lint |
4c156521 | 35 | run: pnpm lint |
73db65c0 | 36 | |
4b85ba43 | 37 | - name: Production Build |
4c156521 | 38 | run: pnpm build:prod |
4b85ba43 | 39 | |
cf523f68 | 40 | publish-npm: |
90bd5e47 | 41 | needs: build |
42 | runs-on: ubuntu-latest | |
43 | ||
44 | steps: | |
45 | - name: Checkout | |
b358d1ac | 46 | uses: actions/checkout@v4 |
90bd5e47 | 47 | |
4c156521 | 48 | - name: Setup pnpm |
2ca706c4 | 49 | uses: pnpm/action-setup@v3 |
4c156521 JB |
50 | with: |
51 | version: 8 | |
52 | ||
8ea47589 | 53 | - name: Setup Node.js |
6c527d3f | 54 | uses: actions/setup-node@v4 |
11caf266 | 55 | with: |
277c49bf | 56 | node-version: '20.x' |
11caf266 | 57 | registry-url: https://registry.npmjs.org/ |
4c156521 | 58 | cache: 'pnpm' |
515e5da7 | 59 | |
f1c674cd | 60 | - name: Install Dependencies |
c1a37d98 | 61 | run: pnpm install --ignore-scripts --frozen-lockfile |
53e40a19 | 62 | |
5716dd56 | 63 | - name: Read package.json version |
5716dd56 | 64 | id: package-version |
8fddc4b9 | 65 | uses: jaywcjlove/github-action-package@main |
5716dd56 | 66 | |
5716dd56 S |
67 | - name: Publish Release |
68 | if: ${{ contains(steps.package-version.outputs.version, '-') == false }} | |
a454d573 | 69 | run: pnpm publish --no-git-checks |
11caf266 | 70 | env: |
74aeaae0 | 71 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
5716dd56 | 72 | |
17c90274 | 73 | - name: Publish Pre-Release |
04805b54 | 74 | if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }} |
a454d573 | 75 | run: pnpm publish --no-git-checks --tag next |
5716dd56 | 76 | env: |
74aeaae0 | 77 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
17c90274 | 78 | |
8ea47589 JB |
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 }} | |
cf523f68 | 84 | |
aaf31914 JB |
85 | # publish-gpr: |
86 | # needs: build | |
87 | # runs-on: ubuntu-latest | |
88 | # permissions: | |
89 | # contents: read | |
90 | # packages: write | |
91 | ||
92 | # steps: | |
93 | # - name: Checkout | |
94 | # uses: actions/checkout@v4 | |
95 | ||
96 | # - name: Setup pnpm | |
2ca706c4 | 97 | # uses: pnpm/action-setup@v3 |
aaf31914 JB |
98 | # with: |
99 | # version: 8 | |
100 | ||
101 | # - name: Setup Node.js | |
6c527d3f | 102 | # uses: actions/setup-node@v4 |
aaf31914 | 103 | # with: |
277c49bf | 104 | # node-version: '20.x' |
aaf31914 JB |
105 | # registry-url: https://npm.pkg.github.com |
106 | # cache: 'pnpm' | |
107 | ||
f1c674cd | 108 | # - name: Install Dependencies |
c1a37d98 | 109 | # run: pnpm install --ignore-scripts --frozen-lockfile |
aaf31914 JB |
110 | |
111 | # - name: Read package.json version | |
112 | # id: package-version | |
113 | # uses: jaywcjlove/github-action-package@main | |
114 | ||
115 | # - name: Publish Release | |
116 | # if: ${{ contains(steps.package-version.outputs.version, '-') == false }} | |
117 | # run: pnpm publish --no-git-checks | |
118 | # env: | |
119 | # NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }} | |
120 | ||
121 | # - name: Publish Pre-Release | |
122 | # if: ${{ contains(steps.package-version.outputs.version, '-') == true && contains(steps.package-version.outputs.version, '-beta') == false }} | |
123 | # run: pnpm publish --no-git-checks --tag next | |
124 | # env: | |
125 | # NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }} | |
126 | ||
127 | # - name: Publish Beta Release | |
128 | # if: ${{ contains(steps.package-version.outputs.version, '-beta') == true }} | |
129 | # run: pnpm publish --no-git-checks --tag beta | |
130 | # env: | |
131 | # NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }} |