Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ name: "Release: Publish to PyPi"

on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 0.3.0)'
required: true
type: string

permissions:
contents: write
Expand All @@ -18,9 +13,22 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Validate branch
run: |
if [[ ! "${{ github.ref_name }}" =~ ^release/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Must run from a release/v* branch (e.g., release/v0.3.0)"
exit 1
fi

- name: Extract version
id: version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#release/v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"

- uses: actions/checkout@v4
with:
ref: release/v${{ inputs.version }}

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand All @@ -46,6 +54,6 @@ jobs:
run: |
gh pr create \
--base main \
--head "release/v${{ inputs.version }}" \
--title "chore: merge release v${{ inputs.version }} to main" \
--body "Syncs version bump and CHANGELOG from release v${{ inputs.version }} to main."
--head "${{ github.ref_name }}" \
--title "chore: merge release v${{ steps.version.outputs.version }} to main" \
--body "Syncs version bump and CHANGELOG from release v${{ steps.version.outputs.version }} to main."