.github/workflows/publish-npm.yml
name: Publish to npm registry
on:
workflow_call:
secrets:
PUBLISH_NPM_TOKEN:
required: true
jobs:
npmjs:
name: Publish to npm registry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist/
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_NPM_TOKEN }}