fix: use twine for PyPI upload with internal URL
All checks were successful
Build and Publish ray-serve-apps / lint (push) Successful in 1m32s
Build and Publish ray-serve-apps / publish (push) Successful in 2m4s

Replaces curl-based upload with twine which handles the
PyPI upload protocol correctly. Uses TWINE_REPOSITORY_URL
env var to point to internal Gitea service.
This commit is contained in:
2026-02-02 12:40:33 -05:00
parent 18302cf640
commit 4e813cea64

View File

@@ -63,6 +63,7 @@ jobs:
env:
TWINE_USERNAME: ${{ secrets.REGISTRY_USER }}
TWINE_PASSWORD: ${{ secrets.REGISTRY_TOKEN }}
TWINE_REPOSITORY_URL: http://gitea-http.gitea.svc.cluster.local:3000/api/packages/daviestechlabs/pypi
run: |
cd ray-serve
# Debug: check if secrets are set (don't print the token!)
@@ -72,24 +73,8 @@ jobs:
echo "ERROR: REGISTRY_USER or REGISTRY_TOKEN secrets not set"
exit 1
fi
# Use internal cluster service URL directly - no SSL, no auth proxy
for file in dist/*.whl dist/*.tar.gz; do
if [ -f "$file" ]; then
echo "Uploading $file..."
response=$(curl -s -w "\n%{http_code}" -X POST \
-u "$TWINE_USERNAME:$TWINE_PASSWORD" \
-F "content=@$file" \
"http://gitea-http.gitea.svc.cluster.local:3000/api/packages/daviestechlabs/pypi/upload")
http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')
echo "Response: $body"
echo "HTTP Code: $http_code"
if [ "$http_code" != "201" ] && [ "$http_code" != "200" ]; then
echo "Upload failed with HTTP $http_code"
exit 1
fi
fi
done
# Use twine for proper PyPI upload protocol
python -m twine upload --verbose dist/*
- name: Notify on success
if: success()