[FIX] wheelhouse: drop unsupported twine --skip-existing
All checks were successful
wheelhouse / wheelhouse (push) Successful in 19s
All checks were successful
wheelhouse / wheelhouse (push) Successful in 19s
twine only allows --skip-existing for PyPI/TestPyPI, not custom repositories like the Forgejo registry. Upload wheels individually and treat an "already exists" (HTTP 409) response as a skip to keep re-runs idempotent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
11e7fe721c
commit
423a593486
1 changed files with 19 additions and 2 deletions
|
|
@ -116,5 +116,22 @@ jobs:
|
|||
# secret if you tighten the default token permissions.
|
||||
TWINE_PASSWORD: ${{ secrets.WHEELHOUSE_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# --skip-existing keeps re-runs idempotent should a version collide.
|
||||
uvx twine upload --non-interactive --skip-existing dist/*
|
||||
set -euo pipefail
|
||||
# twine's --skip-existing only works for PyPI/TestPyPI, not custom
|
||||
# repositories, so we upload wheel-by-wheel and treat an
|
||||
# "already exists" (HTTP 409) response as a skip to stay idempotent.
|
||||
for whl in dist/*.whl ; do
|
||||
echo "::group::Uploading $(basename "$whl")"
|
||||
if out="$(uvx twine upload --non-interactive --disable-progress-bar "$whl" 2>&1)" ; then
|
||||
echo "$out"
|
||||
else
|
||||
echo "$out"
|
||||
if echo "$out" | grep -qiE "409|already exist|conflict" ; then
|
||||
echo "Version already published, skipping."
|
||||
else
|
||||
echo "::endgroup::"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in a new issue