Skip to content

v2.21.0

v2.21.0 #110

Workflow file for this run

name: Publish Package to npmjs
on:
release:
types: [published]
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- name: Prepare publish version
run: bun scripts/prepublish.ts
- name: Build package
run: bun run build
# Node 18 must only be on PATH for the verification below, not during
# the build: typescript >= 7 ships an extensionless ESM bin/tsc that
# Node 18.17 cannot load (ERR_UNKNOWN_FILE_EXTENSION).
- name: Set up Node.js 18 for runtime verification
uses: actions/setup-node@v6
with:
node-version: '18.17.0'
- name: Verify built CLI with Node.js 18
run: |
node --version
node lib/bin.js -v
- name: Set up Node.js for npm publishing
uses: actions/setup-node@v6
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
shell: bash
run: |
if [[ "${{ github.event.release.tag_name }}" == *"beta"* ]]; then
npm publish --ignore-scripts --provenance --access public --tag beta
else
npm publish --ignore-scripts --provenance --access public
fi