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 on NPM | |
| on: | |
| push: | |
| tags: | |
| - v* # Any version tag | |
| permissions: | |
| id-token: write # To publish on NPM with provenance and to federate tokens | |
| contents: write # To make a release on GitHub | |
| jobs: | |
| # Requires an approval | |
| npm-publish: | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: "https://registry.npmjs.org" | |
| - run: npm install | |
| - run: npm publish | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const tag = context.ref.replace('refs/tags/', ''); | |
| await github.rest.repos.createRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag_name: tag, | |
| name: tag, | |
| generate_release_notes: true, | |
| }); |