Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
set -eu
if [ -z "$CARGO_REGISTRY_TOKEN" ]; then echo "CARGO_REGISTRY_TOKEN not set; skipping publish"; exit 0; fi
v=$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -1)
if curl -fsSL "https://index.crates.io/wo/rk/worktablesindex" | sed -n 's/.*"vers":"\([^"]*\)".*/\1/p' | grep -qx "$v"; then
echo "WorkTablesIndex $v is already on crates.io; nothing to publish"
name=$(cargo read-manifest | jq -er '.name')
version=$(cargo read-manifest | jq -er '.version')
if cargo info --registry crates-io "$name@$version" >/dev/null 2>&1; then
echo "$name $version is already on crates.io; nothing to publish"
exit 0
fi
cargo publish -p WorkTablesIndex
cargo publish -p "$name"
Loading