diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e125b69..8c98c58 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -60,14 +60,13 @@ jobs: run: | VERSION="${{ steps.get_version.outputs.version }}" echo "Waiting for gradient-adk==$VERSION to be available on TestPyPI..." - for i in {1..30}; do - if pip install --dry-run --index-url https://test.pypi.org/simple/ \ - --extra-index-url https://pypi.org/simple/ \ - gradient-adk==$VERSION 2>&1 | grep -q "Would install"; then + for i in $(seq 1 30); do + HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://test.pypi.org/pypi/gradient-adk/$VERSION/json") + if [ "$HTTP_CODE" = "200" ]; then echo "✅ Package is available on TestPyPI" exit 0 fi - echo "Attempt $i/30: Package not yet available, waiting 10s..." + echo "Attempt $i/30: Package not yet available (HTTP $HTTP_CODE), waiting 10s..." sleep 10 done echo "❌ Package not available after 5 minutes" @@ -88,7 +87,7 @@ jobs: source test_env/bin/activate # Install the package from TestPyPI with regular PyPI as fallback for dependencies - pip install --index-url https://test.pypi.org/simple/ \ + pip install --no-cache-dir --index-url https://test.pypi.org/simple/ \ --extra-index-url https://pypi.org/simple/ \ gradient-adk==$VERSION @@ -119,4 +118,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: python-package-distributions - path: dist/ \ No newline at end of file + path: dist/