v1.4.0-beta.3 #55
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
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/generator.yml' | |
| - 'generator/sonos-docs/src/**/*.ts' | |
| - 'generator/sonos-docs/package.json' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/generator.yml' | |
| - 'generator/sonos-docs/src/**/*.ts' | |
| - 'generator/sonos-docs/package.json' | |
| release: | |
| types: [published] | |
| jobs: | |
| test: | |
| name: 'Build and test on Node ${{ matrix.node }}' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| node: [22, 24] | |
| defaults: | |
| run: | |
| working-directory: generator/sonos-docs | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build library | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test | |
| npm-publish: | |
| name: 'Publish to npm' | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| defaults: | |
| run: | |
| working-directory: generator/sonos-docs | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup node for npm registry | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set version from release tag | |
| run: npm version --no-git-tag-version "${{ github.event.release.tag_name }}" | |
| - name: Build library | |
| run: npm run prepack | |
| - name: Publish to npm | |
| run: npm publish --access public --provenance --tag ${{ github.event.release.prerelease && 'beta' || 'latest' }} | |
| - name: Setup node for GitHub Package Registry | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@svrooij' | |
| - name: Publish to GitHub Package Registry | |
| run: npm publish --tag ${{ github.event.release.prerelease && 'beta' || 'latest' }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |