From 3873938865adf01d9f47ace4ae9fd62e38409d63 Mon Sep 17 00:00:00 2001 From: Ian Ross Date: Fri, 13 Feb 2026 17:52:47 +0100 Subject: [PATCH] Add release script and release notes generation --- .github/workflows/release.yml | 1 + scripts/release.sh | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100755 scripts/release.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d199265..2730e5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,3 +52,4 @@ jobs: uses: softprops/action-gh-release@v2 with: files: dist/* + generate_release_notes: true diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000..be55953 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ $# -ne 1 ]; then + echo "Usage: $0 {major|minor|patch}" + exit 1 +fi + +PART=$1 + +# Ensure clean working tree +if ! git diff-index --quiet HEAD --; then + echo "Working tree is dirty. Commit or stash changes." + exit 1 +fi + +git checkout main +git pull upstream main + +uv run bump-my-version bump "$PART" +uv lock +git add uv.lock +git commit --amend --no-edit + +VERSION=$(uv run python - <<'EOF' +import tomllib +with open("pyproject.toml", "rb") as f: + print(tomllib.load(f)["project"]["version"]) +EOF +) + +BRANCH="release-$VERSION" + +git checkout -b "$BRANCH" +git push origin "$BRANCH" + +echo +echo "Release branch created: $BRANCH" +echo "Open a PR, merge it, then run:" +echo +echo " git checkout main" +echo " git pull upstream main" +echo " git tag -a v$VERSION -m 'Release v$VERSION'" +echo " git push upstream v$VERSION"