Skip to content

支持 github actions上集成 npm publish上传代码后就自动推送到 npm, 修复其他问题 #6

支持 github actions上集成 npm publish上传代码后就自动推送到 npm, 修复其他问题

支持 github actions上集成 npm publish上传代码后就自动推送到 npm, 修复其他问题 #6

Workflow file for this run

name: Publish to npm
on:
release:
types: [created]
push:
branches: [master]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}