6.7.1 #199
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: Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| release_to_npm: | |
| name: Release to npm | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 # Ensures it gets the tags and history correctly | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| run_install: false | |
| - name: Use Node.js 24.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.x | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build-serial | |
| env: | |
| NODE_OPTIONS: --max_old_space_size=4096 | |
| - run: pnpm test | |
| - run: pnpm run lint | |
| - name: Determine npm tag based on release version | |
| id: get_npm_tag | |
| run: | | |
| TAG_NAME="${{ github.ref_name }}" | |
| NPM_TAG_VALUE="latest" # Default tag | |
| if [[ "$TAG_NAME" == *alpha* || "$TAG_NAME" == *beta* || "$TAG_NAME" == *pre* ]]; then | |
| NPM_TAG_VALUE="next" | |
| fi | |
| echo "NPM_TAG=${NPM_TAG_VALUE}" >> $GITHUB_ENV | |
| echo "Determined NPM_TAG: ${NPM_TAG_VALUE}" | |
| - run: pnpm exec nx release publish --tag=$NPM_TAG --provenance | |
| env: | |
| # This ensures the npm CLI knows which registry to authenticate against using OIDC | |
| NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/" | |
| # If using Nx, it also needs the GitHub token for the release side | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # This tells npm to use the OIDC token for the registry | |
| NODE_AUTH_TOKEN: ${{ steps.get_id_token.outputs.token }} |