Skip to content

add cjs fix

add cjs fix #1

Workflow file for this run

name: Publish to npm
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Upgrade npm (trusted publishing requires >= 11.12.1)
run: npm install -g npm@11.12.1
- name: Set package version from tag
run: |
PACKAGE_VERSION="${GITHUB_REF_NAME#v}"
echo "Publishing version: $PACKAGE_VERSION"
npm version "$PACKAGE_VERSION" --no-git-tag-version --allow-same-version
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Publish to npm
run: npm publish