Skip to content

Commit 5a5c8c8

Browse files
committed
fix package publishing errors
1 parent 1172332 commit 5a5c8c8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/publish.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,15 @@ jobs:
201201
202202
- name: Publish crate
203203
run: |
204-
cargo publish
204+
# Extract version from Cargo.toml
205+
VERSION=$(grep -m 1 '^version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
206+
207+
# Check if version already exists
208+
if cargo search cddl --limit 1 | grep -q "cddl = \"$VERSION\""; then
209+
echo "Version $VERSION already exists on crates.io, skipping publish"
210+
else
211+
cargo publish
212+
fi
205213
206214
publish-website:
207215
name: Publish website

0 commit comments

Comments
 (0)