Skip to content

Publish

Publish #123

Workflow file for this run

name: Publish
on:
release:
types:
- released
workflow_dispatch:
# Trusted Publishing (OIDC): npm mints a short-lived, workflow-scoped token
# at run time — no long-lived NPM_TOKEN secret to expire or rotate.
# Requires a Trusted Publisher configured on npmjs.com for this repo +
# workflow filename, npm >= 11.5.1, and Node >= 22.14.0.
permissions:
id-token: write
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
# Node 24 ships a working npm 11.x. Node 22.22.2's toolcache npm
# (10.9.7) has a broken module tree (missing promise-retry) that makes
# `npm install -g` abort with MODULE_NOT_FOUND — see
# actions/runner-images#13883 / nodejs/node#62425. Upgrading from a
# healthy npm 11.x base avoids that and guarantees OIDC support (>= 11.5.1).
- name: Node 24
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Upgrade npm for OIDC trusted publishing
run: npm install -g npm@latest
- name: NPM install
run: npm install
- name: Build
run: npm run build
- name: Publish
run: npm publish