From f07c911e1ae4e2d3e18943b787b66bb435beb502 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Sat, 14 Feb 2026 22:46:57 -0600 Subject: [PATCH] fix(#1): Fix publish step - check simple index for existing version Gitea PyPI registry does not support twine --skip-existing. Instead, curl the simple index page and grep for the version in filenames before attempting upload. Uses underscore naming (mosaicstack_telemetry) to match actual sdist/wheel filenames. Refs #1 Co-Authored-By: Claude Opus 4.6 --- .woodpecker.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index c621e38..b91aa66 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -70,14 +70,19 @@ steps: CURRENT=$$(uv run python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])") echo "Building version $$CURRENT..." uv build - echo "Publishing $$CURRENT..." - uv run twine upload \ - --repository-url "https://git.mosaicstack.dev/api/packages/mosaic/pypi" \ - --username "$$GITEA_USER" \ - --password "$$GITEA_TOKEN" \ - --skip-existing \ - dist/* - echo "Published mosaicstack-telemetry $$CURRENT" + echo "Checking if $$CURRENT is already published..." + INDEX_PAGE=$$(curl -sf "https://git.mosaicstack.dev/api/packages/mosaic/pypi/simple/mosaicstack-telemetry/" 2>/dev/null || echo "") + if echo "$$INDEX_PAGE" | grep -q "mosaicstack_telemetry-$$CURRENT"; then + echo "Version $$CURRENT already published, skipping upload" + else + echo "Publishing $$CURRENT..." + uv run twine upload \ + --repository-url "https://git.mosaicstack.dev/api/packages/mosaic/pypi" \ + --username "$$GITEA_USER" \ + --password "$$GITEA_TOKEN" \ + dist/* + echo "Published mosaicstack-telemetry $$CURRENT" + fi when: - branch: [main, develop] event: [push, manual, tag]