@@ -3,10 +3,7 @@ name: 🧪 Test and 🚀 Release
33on :
44 push :
55 branches :
6- - main
7- - beta
8- pull_request : {}
9- workflow_dispatch : {}
6+ - test-release
107
118jobs :
129 test-and-release :
3229 uses : actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # main
3330
3431 - name : 🟢 Setup Node.js
35- uses : actions/setup-node@d02c89dce7e1ba9ef629ce0680989b3a1cc72edb # main
32+ uses : actions/setup-node@774c1d62961e73038a114d59c8847023c003194d # main
3633 with :
3734 node-version-file : " .tool-versions"
3835 cache : " npm"
@@ -44,41 +41,13 @@ jobs:
4441 path : " **/node_modules"
4542 key : node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
4643
47- - name : 🗄 Cache .eslintcache
48- uses : actions/cache@b7e8d49f17405cc70c1c120101943203c98d3a4b # main
49- with :
50- path : .eslintcache
51- key : eslintcache-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
52-
5344 - name : 🔍 Install dependencies
5445 if : steps.cache-node_modules.outputs.cache-hit != 'true'
5546 run : |
5647 npm ci --ignore-scripts --prefer-offline --no-audit
5748
58- - name : 🧪 Run tests
59- env :
60- CI : true
61- run : |
62- npm test
63-
64- - name : ⬆️ Upload coverage report
65- uses : coverallsapp/github-action@ba6dae83310bbd6d33ff77092650dc40bd444a2a # main
66- with :
67- github-token : ${{ secrets.GITHUB_TOKEN }}
68-
69- - name : 🚀 Release preview
70- if : ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/beta' }}
71- # Call to npm publish --dry-run is currently necessary, see https://github.com/stackblitz-labs/pkg.pr.new/issues/320
72- run : |
73- npm publish --dry-run --tag test-release
74- npx pkg-pr-new publish
75-
7649 - name : 🚀 Release on npm and jsr
77- if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
7850 env :
7951 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
80- # Fetch the last 30 commits to ensure we have a complete CHANGELOG.md
81- # See https://github.com/peerigon/template-public-package/issues/2
8252 run : |
83- git fetch --depth=30
84- npm run release
53+ npx jsr publish
0 commit comments