diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build-test-publish.yml | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 9c7bf41..b70f1f1 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -33,6 +33,26 @@ jobs: - name: Publish to PyPI if: github.ref == 'refs/heads/main' - run: uv publish + run: | + set +e + + # Run uv publish and capture output + OUTPUT=$(uv publish 2>&1) + STATUS=$? + + set -eo pipefail + + echo "$OUTPUT" + + if [ $STATUS -eq 0 ]; then + echo "✅ Publish succeeded." + exit 0 + elif echo "$OUTPUT" | grep -q "400 File already exists"; then + echo "⚠️ Package version already exists on PyPI. Skipping publish." + exit 0 + else + echo "❌ Publish failed unexpectedly." + exit $STATUS + fi env: UV_PUBLISH_TOKEN: ${{ secrets.UV_PYPI_TOKEN }} |
