Skip to content

Commit

Permalink
chore: add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
guansss committed Dec 6, 2023
1 parent b0f9af2 commit 4145c9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Package to npmjs
on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- run: npm ci
- run: npm run setup
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"doc": "node scripts/gen-docs.js",
"serve-docs": "mkdocs serve -f docs/mkdocs.yml",
"deploy": "gh-pages -d site",
"prepublishOnly": "npm run build && npm run test && npm run type",
"prepublishOnly": "npm run type && npm run build && npm run test",
"lint": "eslint . --config .eslintrc.cjs --rule \"prettier/prettier: error\"",
"lint:fix": "npm run lint -- --fix"
},
Expand Down

0 comments on commit 4145c9c

Please sign in to comment.