Skip to content

Commit

Permalink
Add cargo publish script (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJeremyHe authored Dec 16, 2024
1 parent 5503969 commit d036ebc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ logisheets_base = { path = "crates/controller/base", version = "0.7.0" }
logisheets_controller = { path = "crates/controller", version = "0.7.0" }

logisheets_workbook_derives = { path = "crates/workbook/derives", version = "0.7.0" }
xmldiff = { path = "crates/xmldiff", version = "0.7.0" }
logisheets_workbook = { path = "crates/workbook", version = "0.7.0" }

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/workbook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ xmlserde_derives = { workspace = true }
logisheets_workbook_derives = { workspace = true }

[dev-dependencies]
xmldiff = { version = "*", path = "../xmldiff" }
xmldiff = { workspace = true }

[features]
gents = ["dep:gents", "dep:gents_derives"]
34 changes: 34 additions & 0 deletions scripts/cargo-publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

set -e

SCRIPT_DIR=$(dirname "$0")

cd $SCRIPT_DIR
cd ..

MANIFEST_PATHS=(
"crates/xmldiff/Cargo.toml"
"crates/workbook/derives/Cargo.toml"
"crates/workbook/Cargo.toml"
"crates/controller/base/Cargo.toml"
"crates/controller/lexer/Cargo.toml"
"crates/controller/parser/Cargo.toml"
"crates/controller/ast_checker/Cargo.toml"
"crates/controller/Cargo.toml"
"Cargo.toml"
)

for MANIFEST_PATH in "${MANIFEST_PATHS[@]}"; do
echo "Publishing package at: $MANIFEST_PATH"

cargo publish --manifest-path "$MANIFEST_PATH"

sleep 10

if [ $? -eq 0 ]; then
echo "Successfully published: $MANIFEST_PATH"
else
echo "Failed to publish: $MANIFEST_PATH"
fi
done

0 comments on commit d036ebc

Please sign in to comment.