From 0fb34df85e714549bd732a83c587d24f727f3907 Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Mon, 2 Sep 2024 10:45:57 +0200 Subject: [PATCH] chore: add publish script for urdf and stl + unify all releases by default --- publish-all.sh | 14 ++++++++++++++ scripts/publish-extra-formats.sh | 11 +++++++++++ publish.sh => scripts/publish-rapier.sh | 10 +++++----- publish-testbeds.sh => scripts/publish-testbeds.sh | 4 ++-- 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100755 publish-all.sh create mode 100755 scripts/publish-extra-formats.sh rename publish.sh => scripts/publish-rapier.sh (81%) rename publish-testbeds.sh => scripts/publish-testbeds.sh (88%) diff --git a/publish-all.sh b/publish-all.sh new file mode 100755 index 000000000..6be29439c --- /dev/null +++ b/publish-all.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +if [[ "$PUBLISH_MODE" == 1 ]] +then + ./scripts/publish-rapier.sh + ./scripts/publish-testbeds.sh + ./scripts/publish-extra-formats.sh +else + echo "Running in dry mode, re-run with \`PUBLISH_MODE=1 publish-all.sh\` to actually publish." + + DRY_RUN="--dry-run" ./scripts/publish-rapier.sh + DRY_RUN="--dry-run" ./scripts/publish-testbeds.sh + DRY_RUN="--dry-run" ./scripts/publish-extra-formats.sh +fi \ No newline at end of file diff --git a/scripts/publish-extra-formats.sh b/scripts/publish-extra-formats.sh new file mode 100755 index 000000000..505d512a9 --- /dev/null +++ b/scripts/publish-extra-formats.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +currdir=$(pwd) + +### Publish rapier3d-stl. +cd "crates/rapier3d-stl" && cargo publish $DRY_RUN +cd "$currdir" || exit + +### Publish rapier3d-urdf. +cd "crates/rapier3d-urdf" && cargo publish $DRY_RUN +cd "$currdir" || exit \ No newline at end of file diff --git a/publish.sh b/scripts/publish-rapier.sh similarity index 81% rename from publish.sh rename to scripts/publish-rapier.sh index 56c6db047..62432ef2e 100755 --- a/publish.sh +++ b/scripts/publish-rapier.sh @@ -10,26 +10,26 @@ cp -r LICENSE README.md "$tmp"/. ### Publish the 2D version. sed 's#\.\./\.\./src#src#g' crates/rapier2d/Cargo.toml > "$tmp"/Cargo.toml currdir=$(pwd) -cd "$tmp" && cargo publish +cd "$tmp" && cargo publish $DRY_RUN cd "$currdir" || exit ### Publish the 3D version. sed 's#\.\./\.\./src#src#g' crates/rapier3d/Cargo.toml > "$tmp"/Cargo.toml cp -r LICENSE README.md "$tmp"/. -cd "$tmp" && cargo publish +cd "$tmp" && cargo publish $DRY_RUN cd "$currdir" || exit ### Publish the 2D f64 version. sed 's#\.\./\.\./src#src#g' crates/rapier2d-f64/Cargo.toml > "$tmp"/Cargo.toml currdir=$(pwd) -cd "$tmp" && cargo publish +cd "$tmp" && cargo publish $DRY_RUN cd "$currdir" || exit ### Publish the 3D f64 version. sed 's#\.\./\.\./src#src#g' crates/rapier3d-f64/Cargo.toml > "$tmp"/Cargo.toml cp -r LICENSE README.md "$tmp"/. -cd "$tmp" && cargo publish +cd "$tmp" && cargo publish $DRY_RUN -rm -rf "$tmp" +rm -rf "$tmp" \ No newline at end of file diff --git a/publish-testbeds.sh b/scripts/publish-testbeds.sh similarity index 88% rename from publish-testbeds.sh rename to scripts/publish-testbeds.sh index cf2b259f8..f9187cc32 100755 --- a/publish-testbeds.sh +++ b/scripts/publish-testbeds.sh @@ -13,7 +13,7 @@ cp -r LICENSE README.md "$tmp"/. gsed 's#\.\./\.\./src#src#g' crates/rapier_testbed2d/Cargo.toml > "$tmp"/Cargo.toml gsed -i 's#\.\./rapier#./crates/rapier#g' "$tmp"/Cargo.toml currdir=$(pwd) -cd "$tmp" && cargo publish +cd "$tmp" && cargo publish $DRY_RUN cd "$currdir" || exit @@ -21,6 +21,6 @@ cd "$currdir" || exit gsed 's#\.\./\.\./src#src#g' crates/rapier_testbed3d/Cargo.toml > "$tmp"/Cargo.toml gsed -i 's#\.\./rapier#./crates/rapier#g' "$tmp"/Cargo.toml cp -r LICENSE README.md "$tmp"/. -cd "$tmp" && cargo publish +cd "$tmp" && cargo publish $DRY_RUN rm -rf "$tmp"