v.23.1.3 #102
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
| # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | |
| name: Release | |
| on: | |
| release: | |
| types: [released, prereleased] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| - name: Clean cache | |
| run: npm cache clean --force | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Test | |
| run: npm test | |
| publish-npm: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org/ | |
| - run: npm ci | |
| # Build for prerelease (beta) | |
| - name: Build for beta | |
| if: github.event.release.prerelease == true | |
| run: npm run prepare | |
| # Build for release (stable) | |
| - name: Build for release | |
| if: github.event.release.prerelease == false | |
| run: npm run build:lib | |
| # Publish beta version with beta tag | |
| - name: Publish beta | |
| if: github.event.release.prerelease == true | |
| run: cd ./lib && npm publish --tag beta --provenance --access public | |
| # Publish stable version with default (latest) tag | |
| - name: Publish release | |
| if: github.event.release.prerelease == false | |
| run: cd ./lib && npm publish --provenance --access public |