Update publish workflow to handle beta and latest tag releases #1
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: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| id-token: write # Required for OIDC | |
| 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: npm ci | |
| - name: Extract tag name | |
| id: tag | |
| run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Publish with beta tag | |
| if: contains(steps.tag.outputs.TAG_NAME, 'beta') | |
| run: echo npm publish --tag beta | |
| - name: Publish with latest tag | |
| if: "!contains(steps.tag.outputs.TAG_NAME, 'beta')" | |
| run: echo npm publish |