Publish to npm #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to npm | |
on: | |
release: | |
types: [published] | |
jobs: | |
test-and-publish: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run tests | |
run: pnpm run test | |
- name: Publish to npm | |
run: pnpm publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |