Skip to content

Commit 9b6da53

Browse files
chore: add publish workflow
1 parent 07fbc51 commit 9b6da53

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
name: Publish to npm
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version-file: ".nvmrc"
23+
registry-url: "https://registry.npmjs.org"
24+
- name: Update npm
25+
run: npm install -g npm@latest # Ensure npm 11.5.1 or later is installed
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Run tests
29+
run: npm test
30+
- name: Publish to npm
31+
run: npm publish

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint:fix": "npm run lint:prettier:fix && npm run lint:js:fix",
3434
"test": "node --test --test-reporter spec",
3535
"test:coverage": "node --test --experimental-test-coverage",
36-
"release": "np",
36+
"release": "np --no-publish",
3737
"prepare": "husky install"
3838
},
3939
"dependencies": {

0 commit comments

Comments
 (0)