aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-05-14 15:21:57 +0300
committerJan Tuomi <jan@jantuomi.fi>2025-05-14 15:24:15 +0300
commite84fb2c77bd2bd97daf8ea3b410d6e1e83aedcad (patch)
tree99a1592444c72fe0a0a6985089106d2e83458095 /.github
parentfa1e288a8cea3d8bee44823f6ed887e40b1ecdf8 (diff)
Improve workflow
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build-test-publish.yml22
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 }}