| 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 harlequin main branch |
| 19 |
uses: actions/checkout@v7 |
| 20 |
with: |
| 21 |
ref: main |
| 22 |
|
| 23 |
- name: Set up Python 3.10 |
| 24 |
uses: actions/setup-python@v7 |
| 25 |
with: |
| 26 |
python-version: "3.10" |
| 27 |
|
| 28 |
- name: Install uv |
| 29 |
uses: astral-sh/[email protected] |
| 30 |
with: |
| 31 |
version: "0.12.13" |
| 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 |
# the hsql metapackage ships with this release, carrying the same |
| 40 |
# version and pinning it. --frozen because the pin it is being given |
| 41 |
# is a release that does not exist yet: there is nothing to resolve |
| 42 |
# against until this branch merges and publishes. |
| 43 |
run: | |
| 44 |
uv version ${{ github.event.inputs.newVersion }} |
| 45 |
uv version --project packaging/hsql --frozen ${{ github.event.inputs.newVersion }} |
| 46 |
uv add --project packaging/hsql --frozen "harlequin==${{ github.event.inputs.newVersion }}" |
| 47 |
|
| 48 |
- name: Bump the versions uv cannot reach |
| 49 |
# the plugin manifest, which is the skill for one release of hsql, and |
| 50 |
# the session protocol's version, which its client cannot afford to |
| 51 |
# read off the package metadata. |
| 52 |
run: python scripts/bump_versions.py ${{ github.event.inputs.newVersion }} |
| 53 |
|
| 54 |
- name: Ensure packages can be built |
| 55 |
run: | |
| 56 |
uv build --all-packages |
| 57 |
uv build packaging/hsql --out-dir dist |
| 58 |
|
| 59 |
- name: Update CHANGELOG |
| 60 |
uses: thomaseizinger/keep-a-changelog-new-release@v3 |
| 61 |
with: |
| 62 |
version: ${{ github.event.inputs.newVersion }} |
| 63 |
|
| 64 |
- name: Commit Changes |
| 65 |
uses: stefanzweifel/git-auto-commit-action@v7 |
| 66 |
with: |
| 67 |
commit_message: Bumps version to ${{ github.event.inputs.newVersion }} |
| 68 |
|
| 69 |
- name: Create pull request into main |
| 70 |
uses: thomaseizinger/[email protected] |
| 71 |
env: |
| 72 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 |
with: |
| 74 |
head: release/v${{ github.event.inputs.newVersion }} |
| 75 |
base: main |
| 76 |
title: v${{ github.event.inputs.newVersion }} |
| 77 |
body: > |
| 78 |
This PR was automatically generated. It bumps the version number |
| 79 |
in pyproject.toml and updates CHANGELOG.md. You may have to close |
| 80 |
this PR and reopen it to get the required checks to run. |