Release v1.5.0-beta202606250002 #17
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 | |
| permissions: | |
| contents: write # To attach assets to releases | |
| id-token: write # OIDC token for npm trusted publishing | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build package | |
| run: npm run build | |
| # Convert tags like `> [!NOTE]` to `> **Note**` because npm does | |
| # not render GFM admonitions. | |
| - name: Strip GFM admonitions from README (npm only) | |
| run: | | |
| sed -i -E 's/^([[:space:]]*>)[[:space:]]*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][[:space:]]*$/\1 **\L\u\2**/Ig' README.md | |
| # Reuse same npm pack by both the upload and publish so release asset | |
| # matches npm tarball | |
| - name: Pack the publishable tarball | |
| run: npm pack | |
| - name: Upload dist and npm tarball as release assets | |
| run: | | |
| zip -r dist.zip dist | |
| gh release upload "$TAG_NAME" dist.zip *.tgz --clobber | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| - name: Publish to npm | |
| run: | | |
| if [[ "${{ github.event.release.prerelease }}" != "false" ]]; then | |
| npm publish *.tgz --tag beta | |
| else | |
| npm publish *.tgz | |
| fi |