v2.20.4 #109
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 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 |