From 558a6e2f9599301fb44288d86067898c3a3b5728 Mon Sep 17 00:00:00 2001 From: Simon Ives <94089336+simonives@users.noreply.github.com> Date: Sun, 4 Oct 2026 12:11:14 +1000 Subject: [PATCH] chore: do not publish v0.x tags to PyPI Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/release.yml | 3 ++- CHANGELOG.md | 3 +++ tests/test_release_workflow.py | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b4b3ac..239b787 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,8 +96,9 @@ jobs: pip install build python -m build + # Reed is not published to PyPI before v1.0.0; 0.x tags still get the image and a GitHub Release. - name: Publish to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !startsWith(github.ref, 'refs/tags/v0.') uses: pypa/gh-action-pypi-publish@release/v1 with: skip-existing: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 016bf03..d3d1b09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ Reed uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- The release workflow no longer publishes `v0.*` tags to PyPI. They still build and push the container image and create a GitHub Release. PyPI publishing starts at v1.0.0 + ## [0.6.1] - 2026-10-04 ### Added diff --git a/tests/test_release_workflow.py b/tests/test_release_workflow.py index 097f935..f5d339d 100644 --- a/tests/test_release_workflow.py +++ b/tests/test_release_workflow.py @@ -123,9 +123,18 @@ def test_publish_and_release_steps_are_gated_on_real_tag_push_only(self): if the logic were inverted.""" workflow = _load_release_workflow() expected = "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')" - for step_name in ("Publish to PyPI", "Create GitHub Release"): - step = _find_step(workflow, step_name) - assert step.get("if", "").strip() == expected + release = _find_step(workflow, "Create GitHub Release") + assert release.get("if", "").strip() == expected + pypi = _find_step(workflow, "Publish to PyPI") + assert pypi.get("if", "").strip().startswith(expected) + + def test_pypi_publish_is_blocked_for_pre_v1_tags(self): + """Reed is not published to PyPI before v1.0.0 (maintainer decision). + 0.x tags still build the image and create a GitHub Release, but the + PyPI step must carry an explicit exclusion for `v0.` tags.""" + workflow = _load_release_workflow() + condition = _find_step(workflow, "Publish to PyPI").get("if", "") + assert "!startsWith(github.ref, 'refs/tags/v0.')" in condition def test_publish_to_pypi_skips_existing_to_survive_a_retry(self): """If a later step (e.g. Create GitHub Release) fails after PyPI