Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
environment: npm-publish
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
# DO NOT use registry-url — it interferes with OIDC

- name: Upgrade npm (OIDC requires >= 11.5.1)
run: npm install -g npm@latest

- name: Configure npm registry
run: npm config set registry https://registry.npmjs.org/

- run: pnpm install --frozen-lockfile

- run: pnpm run build

- run: pnpm test

- name: Set version from release tag
run: npm version "${GITHUB_REF_NAME#v}" --no-git-tag-version

- name: Publish to npm via OIDC
run: npm publish --access public --provenance