v0.3.0 – Capture + Analysis Pipeline Release #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 Node.js Package | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js (with Corepack/Yarn) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'yarn' | |
| - run: corepack enable | |
| - name: Install deps (Yarn 4 workspaces) | |
| run: yarn install --immutable | |
| - name: Build (bob via prepare) | |
| run: yarn prepare | |
| - name: Ensure version not already on npm | |
| run: | | |
| NAME="$(node -p "require('./package.json').name")" | |
| VER="$(node -p "require('./package.json').version")" | |
| if npm view "${NAME}@${VER}" version >/dev/null 2>&1; then | |
| echo "::error::${NAME}@${VER} already exists on npm" | |
| exit 1 | |
| fi | |
| - name: Publish to npm | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public |