changeset-release.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Changeset Release
  2. on:
  3. push:
  4. branches:
  5. - main
  6. workflow_dispatch:
  7. env:
  8. REPO_PATH: ${{ github.repository }}
  9. GIT_REF: main
  10. NODE_VERSION: 20.20.0
  11. PNPM_VERSION: 10.8.1
  12. jobs:
  13. # Job 1: Create version bump PR when changesets are merged to main
  14. changeset-pr-version-bump:
  15. runs-on: ubuntu-latest
  16. permissions:
  17. contents: write
  18. pull-requests: write
  19. steps:
  20. - name: Git Checkout
  21. uses: actions/checkout@v6
  22. with:
  23. fetch-depth: 0
  24. ref: ${{ env.GIT_REF }}
  25. - name: Install pnpm
  26. uses: pnpm/action-setup@v4
  27. with:
  28. version: ${{ env.PNPM_VERSION }}
  29. - name: Setup Node.js
  30. uses: actions/setup-node@v6
  31. with:
  32. node-version: ${{ env.NODE_VERSION }}
  33. cache: "pnpm"
  34. - name: Install Dependencies
  35. run: pnpm install
  36. # Create version bump PR using changesets/action
  37. - name: Changeset Pull Request
  38. id: changesets
  39. uses: changesets/action@v1
  40. with:
  41. commit: "changeset version bump"
  42. title: "Changeset version bump"
  43. version: pnpm changeset:version # This performs the changeset version bump
  44. env:
  45. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}