Skip to content

Commit 83c3003

Browse files
makegov-mark[bot]vdavezclaude
authored
ci(publish): make the PyPI upload idempotent so a Release cannot go red over a duplicate (#57)
`uv publish` fails the run when a file is already on the index, so any version that reached PyPI by another route — a manual `uv publish`, a re-run of this workflow, a partial upload — makes the GitHub Release that triggers it go red even though the package is fine and nothing needs doing. That is exactly what happened with 1.5.0: it was published by hand before the Release existed, which left cutting the Release as a choice between skipping it (losing the tag and notes every prior version has) and accepting a failed run attached to it. `--check-url` has uv query the index first and skip files already present, so the step is a no-op instead of an error. Re-running the workflow is now always safe. Co-authored-by: V. David Zvenyach <dave@zvenyach.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 0b1e94c commit 83c3003

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ jobs:
2626
- name: Publish to PyPI
2727
env:
2828
UV_PUBLISH_TOKEN: ${{ secrets.TANGO_PYPI_TOKEN }}
29-
run: uv publish
29+
# --check-url makes the upload idempotent: uv queries the index first and skips
30+
# files already present instead of failing the run. Without it, any version that
31+
# reached PyPI by another route — a manual `uv publish`, a re-run of this
32+
# workflow — makes the GitHub Release that follows it go red for no real reason.
33+
run: uv publish --check-url https://pypi.org/simple/

0 commit comments

Comments
 (0)