| 1 | name: Create Release Branch |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | inputs: |
| 6 | newVersion: |
| 7 | description: A version number for this release (e.g., "0.1.0") |
| 8 | required: true |
| 9 | |
| 10 | jobs: |
| 11 | prepare-release: |
| 12 | runs-on: ubuntu-latest |
| 13 | permissions: |
| 14 | contents: write |
| 15 | pull-requests: write |
| 16 | |
| 17 | steps: |
| 18 | - name: Check out repo main branch |
| 19 | uses: actions/checkout@v5 |
| 20 | with: |
| 21 | ref: main |
| 22 | |
| 23 | - name: Set up Python |
| 24 | uses: actions/setup-python@v6 |
| 25 | with: |
| 26 | python-version-file: ".python-version" |
| 27 | |
| 28 | - name: Install uv |
| 29 | uses: astral-sh/setup-uv@v6 |
| 30 | with: |
| 31 | version: "0.9.3" |
| 32 | |
| 33 | - name: Create release branch |
| 34 | run: | |
| 35 | git checkout -b release/v${{ github.event.inputs.newVersion }} |
| 36 | git push --set-upstream origin release/v${{ github.event.inputs.newVersion }} |
| 37 | |
| 38 | - name: Bump version |
| 39 | run: uv version ${{ github.event.inputs.newVersion }} |
| 40 | |
| 41 | - name: Ensure package can be built |
| 42 | run: uv build --all-packages |
| 43 | |
| 44 | - name: Update CHANGELOG |
| 45 | uses: thomaseizinger/keep-a-changelog-new-release@v3 |
| 46 | with: |
| 47 | version: ${{ github.event.inputs.newVersion }} |
| 48 | |
| 49 | - name: Commit Changes |
| 50 | uses: stefanzweifel/git-auto-commit-action@v6 |
| 51 | with: |
| 52 | commit_message: Bumps version to ${{ github.event.inputs.newVersion }} |
| 53 | |
| 54 | - name: Create pull request into main |
| 55 | uses: thomaseizinger/[email protected] |
| 56 | with: |
| 57 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 58 | head: release/v${{ github.event.inputs.newVersion }} |
| 59 | base: main |
| 60 | title: v${{ github.event.inputs.newVersion }} |
| 61 | body: > |
| 62 | This PR was automatically generated. It bumps the version number |
| 63 | in pyproject.toml and updates CHANGELOG.md. You may have to close |
| 64 | this PR and reopen it to get the required checks to run. |