Publish to NPM public registry on release #3
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 to NPM public registry on release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: 'Tag name' | |
| required: true | |
| default: 'v1.0.1' | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| registry-url: https://registry.npmjs.org/ | |
| - run: npm ci | |
| - run: | | |
| echo "Publishing $TAG_NAME" | |
| npm version ${TAG_NAME} --git-tag-version=false | |
| env: | |
| TAG_NAME: ${{ github.event.inputs.tag_name }} | |
| - run: npm whoami; npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |