chore: add github auto publish npm package

This commit is contained in:
Michael Yang 2024-09-18 10:36:37 +08:00
parent a2a7edb983
commit 2080f59c5c
1 changed files with 6 additions and 4 deletions

View File

@ -4,8 +4,10 @@
name: Node.js Package
on:
release:
types: [created]
push:
tags: [ v* ] # Push events to matching v*, i.e. v1.0, v20.15.10
# release:
# types: [created]
jobs:
build:
@ -16,7 +18,7 @@ jobs:
with:
node-version: 20
- run: npm ci
- run: npm test
- run: npm run build
publish-npm:
needs: build
@ -30,4 +32,4 @@ jobs:
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}