Debian Codegraph @

.github/workflows/release.yml

raw
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.8"
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 plugin manifest
49 # the plugin is the skill for one release of hsql, so it carries that
50 # release's number. It is the only version `uv version` cannot reach.
51 run: python scripts/bump_plugin_version.py ${{ github.event.inputs.newVersion }}
52
53 - name: Ensure packages can be built
54 run: |
55 uv build --all-packages
56 uv build packaging/hsql --out-dir dist
57
58 - name: Update CHANGELOG
59 uses: thomaseizinger/keep-a-changelog-new-release@v3
60 with:
61 version: ${{ github.event.inputs.newVersion }}
62
63 - name: Commit Changes
64 uses: stefanzweifel/git-auto-commit-action@v7
65 with:
66 commit_message: Bumps version to ${{ github.event.inputs.newVersion }}
67
68 - name: Create pull request into main
69 uses: thomaseizinger/[email protected]
70 env:
71 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72 with:
73 head: release/v${{ github.event.inputs.newVersion }}
74 base: main
75 title: v${{ github.event.inputs.newVersion }}
76 body: >
77 This PR was automatically generated. It bumps the version number
78 in pyproject.toml and updates CHANGELOG.md. You may have to close
79 this PR and reopen it to get the required checks to run.