fix: use twine for PyPI upload with internal URL
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:
@@ -63,6 +63,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TWINE_USERNAME: ${{ secrets.REGISTRY_USER }}
|
TWINE_USERNAME: ${{ secrets.REGISTRY_USER }}
|
||||||
TWINE_PASSWORD: ${{ secrets.REGISTRY_TOKEN }}
|
TWINE_PASSWORD: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
TWINE_REPOSITORY_URL: http://gitea-http.gitea.svc.cluster.local:3000/api/packages/daviestechlabs/pypi
|
||||||
run: |
|
run: |
|
||||||
cd ray-serve
|
cd ray-serve
|
||||||
# Debug: check if secrets are set (don't print the token!)
|
# 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"
|
echo "ERROR: REGISTRY_USER or REGISTRY_TOKEN secrets not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Use internal cluster service URL directly - no SSL, no auth proxy
|
# Use twine for proper PyPI upload protocol
|
||||||
for file in dist/*.whl dist/*.tar.gz; do
|
python -m twine upload --verbose dist/*
|
||||||
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
|
|
||||||
|
|
||||||
- name: Notify on success
|
- name: Notify on success
|
||||||
if: success()
|
if: success()
|
||||||
|
|||||||
Reference in New Issue
Block a user