Skip to content

Commit 495cd5e

Browse files
committed
fix: make release workflow idempotent
1 parent 4b57378 commit 495cd5e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ jobs:
8787
working-directory: core
8888
env:
8989
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
90-
run: cargo publish --allow-dirty
90+
run: |
91+
VERSION=$(cargo metadata --no-deps --format-version 1 | python3 -c 'import json,sys; print(json.load(sys.stdin)["packages"][0]["version"])')
92+
if curl -fsSL "https://crates.io/api/v1/crates/a3s-code-core/${VERSION}" >/dev/null 2>&1; then
93+
echo "a3s-code-core ${VERSION} already exists on crates.io, skipping publish."
94+
exit 0
95+
fi
96+
cargo publish --allow-dirty
9197
9298
# ───────────────────────────────────────────────
9399
# Build and publish Node native SDK (reusable)

0 commit comments

Comments
 (0)