v2026.4.7-beta #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to npm | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| id-token: write # Required for OIDC trusted publishing | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| # setup-node with registry-url is required for OIDC trusted publishing | |
| - name: Setup Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update npm to latest for full OIDC provenance support | |
| run: | | |
| npm install -g npm@latest | |
| npm --version | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Publish to npm with OIDC provenance | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| if echo "$VERSION" | grep -qE '(alpha|beta)'; then | |
| TAG=$(echo "$VERSION" | grep -oE '(alpha|beta)') | |
| echo "Pre-release detected: publishing with --tag $TAG" | |
| npm publish --provenance --tag "$TAG" | |
| else | |
| echo "Stable release: publishing with default (latest) tag" | |
| npm publish --provenance | |
| fi |