fix(#1): Use uv run for twine in publish pipeline step
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
twine is installed into the venv via uv pip install, so it must be invoked with `uv run twine` to find it on PATH. Also simplify version check by using twine's --skip-existing flag instead of pip index lookup. Refs #1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -66,24 +66,18 @@ steps:
|
||||
commands:
|
||||
- |
|
||||
uv sync --all-extras --frozen
|
||||
CURRENT=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
||||
uv pip install twine
|
||||
CURRENT=$$(uv run python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
||||
echo "Building version $$CURRENT..."
|
||||
uv build
|
||||
uv pip install twine
|
||||
PUBLISHED=$(pip index versions mosaicstack-telemetry \
|
||||
--index-url "https://$$GITEA_USER:$$GITEA_TOKEN@git.mosaicstack.dev/api/packages/mosaic/pypi/simple/" \
|
||||
2>/dev/null | grep -oP '\(\K[^)]+' || echo "0.0.0")
|
||||
if [ "$$CURRENT" = "$$PUBLISHED" ]; then
|
||||
echo "Version $$CURRENT already published, skipping"
|
||||
else
|
||||
echo "Publishing $$CURRENT (was $$PUBLISHED)..."
|
||||
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
|
||||
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"
|
||||
when:
|
||||
- branch: [main, develop]
|
||||
event: [push, manual, tag]
|
||||
|
||||
Reference in New Issue
Block a user