v2.1.2 #7
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] | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| name: Build & Publish to npm | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.release.target_commitish }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - run: pnpm install --frozen-lockfile | |
| # Bump version to match the release tag (e.g., v2.1.0 → 2.1.0) | |
| - name: Set version from tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| echo "Publishing version $VERSION" | |
| - run: pnpm run build | |
| - run: pnpm run test | |
| - name: Publish to npm | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |