chore: version packages (#368) #199
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: Changesets | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.changeset/**' | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| version: | |
| name: Create Version PR | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| actions: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| token: ${{ secrets.CHANGESETS_TOKEN }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Create Release PR | |
| id: changesets | |
| uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0 | |
| with: | |
| version: pnpm run version | |
| title: 'Next Release: changelog and version packages' | |
| commit: 'chore: version packages' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Add release label to PR | |
| if: steps.changesets.outputs.pullRequestNumber | |
| run: gh pr edit ${{ steps.changesets.outputs.pullRequestNumber }} --add-label release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Trigger publish workflow | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| run: gh workflow run publish.yml -f release_type=stable | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |