Publish To NPM #4
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 | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: "Build and publish to NPM" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.x | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: https://registry.npmjs.org/ | |
- name: Install deps and build | |
run: | | |
pnpm install --no-frozen-lockfile | |
pnpm build | |
- name: Test before publish | |
run: pnpm test | |
- name: Publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: pnpm publish |