From 1e2a827c6fdd79c14aa45af29486ab12c3223975 Mon Sep 17 00:00:00 2001 From: chrishayuk Date: Tue, 14 Jul 2026 15:03:07 +0100 Subject: [PATCH] Fix PyPI publish workflow never triggering release.yml creates GitHub releases using the default GITHUB_TOKEN, whose events don't cascade to trigger other workflows. As a result publish.yml's `release: published` trigger has never fired in the repo's history despite releases being created successfully - every PyPI release so far was published manually. Trigger publish.yml directly off the version tag push (same trigger release.yml uses) so it runs reliably, and add a tag/pyproject.toml version check to guard against publishing a mismatched version. Signed-off-by: chrishayuk --- .github/workflows/publish.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d3c536f..c1f5315 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,9 @@ name: Publish to PyPI on: + push: + tags: + - 'v*.*.*' release: types: [published] workflow_dispatch: @@ -23,6 +26,16 @@ jobs: steps: - uses: actions/checkout@v7 + - name: Verify tag matches pyproject.toml version + if: github.event_name == 'push' + run: | + TAG=${GITHUB_REF#refs/tags/v} + PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2) + if [ "${TAG}" != "${PYPROJECT_VERSION}" ]; then + echo "Error: Tag version (${TAG}) does not match pyproject.toml version (${PYPROJECT_VERSION})" + exit 1 + fi + - name: Install uv uses: astral-sh/setup-uv@v8.3.2 with: