Skip to content

Commit fa4451d

Browse files
authored
Create npm-publish.yml
1 parent f29ac4e commit fa4451d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
- name: Clean install
16+
run: |
17+
rm -rf node_modules package-lock.json
18+
npm install
19+
- name: Run build
20+
run: npm run build
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
name: build-artifacts
24+
path: dist
25+
26+
publish-npm:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 20
34+
registry-url: https://registry.npmjs.org/
35+
- uses: actions/download-artifact@v4
36+
with:
37+
name: build-artifacts
38+
path: dist
39+
- name: Publish to npm
40+
run: npm publish
41+
env:
42+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)