add commit mode to github action (#16) #3
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 | |
| workflow_dispatch: | |
| concurrency: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # This fetches the entire Git history so that Changesets can generate changelogs with the correct commits. | |
| fetch-depth: 0 | |
| - uses: oven-sh/setup-bun@v2 | |
| - run: bun install --frozen-lockfile | |
| - run: bun run build | |
| - name: Create release pull request or publish to npm | |
| id: changesets | |
| uses: changesets/action@v1.4.5 | |
| with: | |
| commitMode: github-api | |
| title: "chore: version packages" | |
| commit: "chore: version packages" | |
| version: bun run changeset version | |
| publish: bun run build && bun run changeset publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |