Skip to content

Commit 08e1b3f

Browse files
committed
feat: add reusable publish workflow for Node.js
1 parent fb6c8aa commit 08e1b3f

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/publish-node.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish (Node.js)
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
NPM_TOKEN:
7+
required: true
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
17+
18+
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
19+
20+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
21+
with:
22+
node-version: lts/*
23+
registry-url: https://registry.npmjs.org
24+
25+
- run: pnpm install --frozen-lockfile
26+
- run: pnpm run build
27+
- run: pnpm test
28+
- run: pnpm publish --no-git-checks --access public
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)