ci(changesets): version packages (#21) #16
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 or publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release or publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: jdx/mise-action@v2 | |
| # npm 11.5.1 or later is required for trusted publishing | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - run: mise x -- pnpm install --frozen-lockfile | |
| - run: mise x -- pnpm run build | |
| - name: Fix executable files for changesets | |
| run: | | |
| chmod -x .husky/commit-msg | |
| - name: Create release pull request or publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm run release | |
| version: pnpm run version | |
| commit: "ci(changesets): version packages" | |
| title: "ci(changesets): version packages" | |
| commitMode: github-api | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Use OIDC for npm authentication instead of NPM_TOKEN | |
| NPM_TOKEN: "" # https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868 | |