From fc23417960afad561df57a866d8dc1cbe1373460 Mon Sep 17 00:00:00 2001 From: Charlie Doern Date: Thu, 4 Dec 2025 14:32:28 -0500 Subject: [PATCH] fix: verbose upload logs and resiliency upload logs using --verbose and have more resilient pkg handling Signed-off-by: Charlie Doern --- actions/upload-packages-and-tag/main.sh | 29 +++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/actions/upload-packages-and-tag/main.sh b/actions/upload-packages-and-tag/main.sh index 2f06a59..1acab56 100755 --- a/actions/upload-packages-and-tag/main.sh +++ b/actions/upload-packages-and-tag/main.sh @@ -140,19 +140,40 @@ for repo in "${REPOS[@]}"; do cd .. else echo "Uploading llama-$repo to testpypi" - python -m twine upload \ + # Try to upload, but don't fail if version already exists + if python -m twine upload \ --repository-url https://test.pypi.org/legacy/ \ --skip-existing \ - dist/*.whl dist/*.tar.gz + --verbose \ + dist/*.whl dist/*.tar.gz 2>&1 | tee /tmp/twine-upload-main.log; then + echo "✅ Successfully uploaded llama-$repo to testpypi" + elif grep -q "File already exists" /tmp/twine-upload-main.log; then + echo "⚠️ Version $VERSION already exists on testpypi for llama-$repo, skipping..." + else + echo "❌ Failed to upload llama-$repo to testpypi" + cat /tmp/twine-upload-main.log + exit 1 + fi # Upload llama_stack_api if it exists if [ "$repo" == "stack" ] && [ -d "src/llama_stack_api" ] && [ -f "src/llama_stack_api/pyproject.toml" ]; then echo "Uploading llama_stack_api to testpypi" cd src/llama_stack_api - python -m twine upload \ + # Try to upload, but don't fail if version already exists + if python -m twine upload \ --repository-url https://test.pypi.org/legacy/ \ --skip-existing \ - dist/*.whl dist/*.tar.gz + --verbose \ + dist/*.whl dist/*.tar.gz 2>&1 | tee /tmp/twine-upload-api.log; then + echo "✅ Successfully uploaded llama_stack_api to testpypi" + elif grep -q "File already exists" /tmp/twine-upload-api.log; then + echo "⚠️ Version $VERSION already exists on testpypi for llama_stack_api, skipping..." + else + echo "❌ Failed to upload llama_stack_api to testpypi" + cat /tmp/twine-upload-api.log + cd - + exit 1 + fi cd - fi fi