Skip to content

Skip release creation if it exists - #5

Merged
thehansys merged 3 commits into
mainfrom
jan/update-release-ci
Nov 18, 2026
Merged

thehansys merged 3 commits into
mainfrom
jan/update-release-ci

Conversation

@thehansys

Copy link
Copy Markdown
Contributor

Why

  • The publish workflow only created a GitHub Release on a manual dispatch from a tag, and it never checked whether one already existed. Tagging and publishing didn't leave a consistent release behind.
  • tonic-fabricate-js already does this: it publishes, then creates the release only if one doesn't exist. This brings the Python client in line with it.

Changes

  • Replace the release step in publish-to-pypi.yml. It reads the version from pyproject.toml and uses v<version> as the tag. If a release for that tag exists, it skips. Otherwise it creates one with generated notes and the dist/*.whl and dist/*.tar.gz files attached.
  • Add a push: tags: v* trigger, so pushing a tag publishes to PyPI and creates the release. Publishing a release from the UI still works, and the step skips because the release is already there.
  • Set workflow permissions to contents: read, with contents: write on the publish job, which creating a release needs.

@thehansys
thehansys merged commit d92b42e into main Nov 18, 2026
6 checks passed
@thehansys
thehansys deleted the jan/update-release-ci branch November 18, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant