Skip to content

Commit 11c1cdf

Browse files
authored
chore: add GitHub Actions workflow for publishing to NPM (#35)
1 parent 5f076b6 commit 11c1cdf

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
registry-url: 'https://registry.npmjs.org'
19+
cache: 'npm'
20+
cache-dependency-path: nodejs/package-lock.json
21+
22+
- name: Install dependencies
23+
working-directory: nodejs
24+
run: npm ci
25+
26+
- name: Build
27+
working-directory: nodejs
28+
run: npm run build
29+
30+
- name: Publish to NPM
31+
working-directory: nodejs
32+
run: npm publish --access public
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)