add new CI guard to check if a changeset was included (#53) #25
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| # Never cancel an in-flight release; serialize instead. | |
| concurrency: | |
| group: release-${{ github.workflow }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write # push the git tag + create the GitHub Release | |
| pull-requests: write # open/update the "Version Packages" PR | |
| id-token: write # npm OIDC trusted publishing | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| registry-url: 'https://registry.npmjs.org' | |
| # Pinned to 11.x: npm 12.0.0 dropped its bundled 'sigstore' module but | |
| # libnpmpublish still requires it when provenance is forced (npm/cli#9722). | |
| - name: Upgrade npm (OIDC trusted publishing needs >= 11.5.1) | |
| run: npm install -g npm@11 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Create Release PR or publish to npm | |
| uses: changesets/action@v1 | |
| with: | |
| version: npx changeset version | |
| publish: npx changeset publish | |
| title: "Version Packages" | |
| commit: "chore: version packages" | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| # No NPM_CONFIG_PROVENANCE: trusted publishing attaches provenance | |
| # automatically; forcing the flag uses the legacy client-side path. |