Release #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: [released] | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: Release to NPM | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Checkout the repository | |
| uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Package the project | |
| run: | | |
| mkdir -p ${{ runner.temp }}/gha-dist | |
| pnpm pack . --pack-destination ${{ runner.temp }}/gha-dist/ | |
| - name: Upload the built package as an artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: npm-package | |
| path: | |
| ${{ runner.temp }}/gha-dist/*.tgz | |
| archive: false | |
| - name: Publish the package to NPM | |
| if: github.event_name == 'release' | |
| env: | |
| NODE_AUTH_TOKEN: ${{ github.event_name == 'release' && secrets.NPM_TOKEN || '' }} | |
| run: pnpm publish --provenance --access public |