Release #13
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: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Package version | |
| type: string | |
| required: true | |
| release: | |
| types: [released] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| name: Publish package to NPM registry | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| # Also it will setup .npmrc file to publish to npm | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.11.0" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update package version | |
| run: | | |
| npm version ${{ inputs.version || github.ref_name }} --no-git-tag-version | |
| - name: Build the package | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Publish to NPM registry | |
| run: | | |
| npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |