Skip to content

Publish Package

Publish Package #3

Workflow file for this run

# This workflow will publish the package to npm when a release is created
# Uses OIDC trusted publishing for secure, tokenless authentication
name: npm-publish
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build
- name: Publish to npm
run: npm publish --provenance --access public