aboutsummaryrefslogtreecommitdiffstats
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
parentfa1e288a8cea3d8bee44823f6ed887e40b1ecdf8 (diff)
Improve workflow
-rw-r--r--.github/workflows/build-test-publish.yml22
-rw-r--r--README.md4
2 files changed, 25 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 }}
diff --git a/README.md b/README.md
index 8e1b31b..3c9da5a 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,10 @@
<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/femtoqueue">
</a>
+<a href="https://github.com/jantuomi/femtoqueue/actions/workflows/build-test-publish.yml">
+<img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/jantuomi/femtoqueue/build-test-publish.yml">
+</a>
+
Ever wanted a zero-dependency, filesystem-backed, lock-free, durable, concurrent, retrying task queue implementation? No?
## Example