v1.3.3 #17
Workflow file for this run
This file contains hidden or 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: | |
inputs: | |
dry_run: | |
description: 'Run without actually publishing (dry run)' | |
required: false | |
default: true | |
type: boolean | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
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 package | |
run: npm run build | |
- name: Run tests | |
run: npm test | |
- name: Run linting | |
run: npm run lint | |
- name: Run type checking | |
run: npm run typecheck | |
- name: Publish to NPM (dry run) | |
if: ${{ github.event.inputs.dry_run == 'true' }} | |
run: npm publish --dry-run --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish to NPM | |
if: ${{ github.event.inputs.dry_run != 'true' }} | |
run: npm publish --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |