Publish Package to npmjs #87
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 to npmjs | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: git config --global user.name ${{ github.actor }} | |
| - run: git config --global user.email "github-action-${{ github.actor }}.users.noreply.github.com" | |
| - run: npm ci | |
| - run: | | |
| if | |
| [[ ${{ github.event.release.tag_name }} == *'alpha'* ]]; | |
| then | |
| npm version ${{ github.event.release.tag_name }}; | |
| npm publish --tag alpha; | |
| elif | |
| [[ ${{ github.event.release.tag_name }} == *'beta'* ]]; | |
| then | |
| npm version ${{ github.event.release.tag_name }}; | |
| npm publish --tag beta; | |
| else | |
| npm publish | |
| fi |