Commit ce58ac8
fix(publish): make publish-pypi idempotent across two-tag release cycles
release-please-config.json uses include-component-in-tag = true, so each
release cycle emits two GitHub release events (agentex-sdk-client-vX.Y.Z
and agentex-sdk-vX.Y.Z). Both events fire publish-pypi.yml, which calls
this script — the script unconditionally publishes both wheels per run,
so the second event's run tries to re-upload artifacts already on PyPI.
Under `set -eux`, twine's non-zero exit on a duplicate upload aborts the
script and turns the GitHub Action red on every other release cycle.
Add --skip-existing to both rye publish invocations. rye 0.44.0 forwards
this flag to `python -mtwine upload --skip-existing`; twine then treats
already-present files as exit 0 with a WARNING in place of HTTPError.
Verified locally against pypiserver: without the flag the second publish
exits non-zero, with the flag it logs `WARNING Skipping ... appears to
already exist` and exits 0.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 659dd19 commit ce58ac8
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
0 commit comments