Skip to content

Commit ef61fff

Browse files
kmjones1979claude
andcommitted
ci: one publish path per package, matching the registered publisher
PyPI matches a trusted publisher on repository, workflow filename and environment, and this repo had two tag-triggered publish paths where only one was registered. Every release would have fired both: one publishing, one failing authentication, and the second to run also tripping "version already exists". Collapsed to the registered path, and added the two guards it was missing — twine check on the artifacts, and a refusal when that version is already on the index, since PyPI does not allow a version to be replaced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019d5ks2kCa4eXD1ftdkECPu
1 parent 0100cc0 commit ef61fff

2 files changed

Lines changed: 16 additions & 49 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,21 @@ jobs:
5353
pip install build
5454
python -m build
5555
56+
# PyPI will not let a version be replaced, so a bad or duplicate upload
57+
# burns that version number permanently. Both checks run before the push.
58+
- name: Check the artifacts
59+
run: |
60+
pip install twine
61+
twine check dist/*
62+
63+
- name: Refuse a version that is already on PyPI
64+
run: |
65+
VERSION=$(python -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
66+
if curl -sf "https://pypi.org/pypi/oneclaw/$VERSION/json" >/dev/null 2>&1; then
67+
echo "oneclaw $VERSION is already published. Bump the version in pyproject.toml."
68+
exit 1
69+
fi
70+
echo "oneclaw $VERSION is not on PyPI yet."
71+
5672
- name: Publish to PyPI
5773
uses: pypa/gh-action-pypi-publish@release/v1

‎.github/workflows/publish.yml‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)