From 423a59348675269baac4cf8d074c863370546669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20G=C3=B6ttsch?= Date: Mon, 8 Jun 2026 22:11:38 +0200 Subject: [PATCH] [FIX] wheelhouse: drop unsupported twine --skip-existing 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) --- .forgejo/workflows/wheelhouse.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/wheelhouse.yml b/.forgejo/workflows/wheelhouse.yml index 7684732..717c2e0 100644 --- a/.forgejo/workflows/wheelhouse.yml +++ b/.forgejo/workflows/wheelhouse.yml @@ -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