From 6a9bcd23af46687905a541e50a1e4cb2a5f7af23 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Tue, 23 Dec 2025 18:14:28 -0500 Subject: [PATCH] Implement automated release workflow Features: - Introduce GitHub Actions workflow for streamlined release management. - Enable manual release triggering via `workflow_dispatch` with specified release type (minor, patch) and name. - Automate crucial release steps: version bumping, lock file updates, committing changes, creating Git tags, and publishing GitHub releases with generated notes. Configuration: - Add `typing-extensions` dependency to `pyproject.toml` for broader Python version compatibility. - Update `uv.lock` to reflect dependency changes and ensure reproducible builds. - Configure workflow with necessary repository write permissions and Personal Access Token (PAT). --- .github/workflows/release.yml | 67 +++++++++++++++++++++++++++++++++++ pyproject.toml | 3 +- uv.lock | 2 +- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ac392c2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,67 @@ +name: Trigger Release + +on: + workflow_dispatch: + inputs: + release_type: + description: "Release type" + required: true + type: choice + options: + - minor + - patch + release_name: + description: "Release name (short title)" + required: true + type: string + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for proper tagging + token: ${{ secrets.CHERRYPICK_PAT }} + + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Bump version + run: | + uv version --bump ${{ inputs.release_type }} + + - name: Update lock file + run: | + uv lock + + - name: Get new version + id: new_version + run: | + NEW_VERSION=$(uv version | awk '{print $2}') + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT + + - name: Commit version bump + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add pyproject.toml uv.lock + git commit -m "Bump version to ${{ steps.new_version.outputs.new_version }}" + git push origin HEAD + + - name: Create and push tag + run: | + git tag ${{ steps.new_version.outputs.new_version }} + git push origin ${{ steps.new_version.outputs.new_version }} + + - name: Create GitHub release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.new_version.outputs.new_version }} + name: ${{ inputs.release_name }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.CHERRYPICK_PAT }} diff --git a/pyproject.toml b/pyproject.toml index 7a92e98..9e30dff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "uv_build" [project] name = "broker" -version = "0.8.0" +version = "0.7.3" description = "The infrastructure middleman." readme = "README.md" requires-python = ">=3.10" @@ -33,6 +33,7 @@ dependencies = [ "rich_click", "ruamel.yaml", "click-shell", + "typing-extensions", # temporary until Python 3.12+ only ] [project.urls] diff --git a/uv.lock b/uv.lock index 066c363..c8cd520 100644 --- a/uv.lock +++ b/uv.lock @@ -138,7 +138,7 @@ wheels = [ [[package]] name = "broker" -version = "0.8.0" +version = "0.8.0rc1" source = { editable = "." } dependencies = [ { name = "click" },