diff options
| author | Thierry Berger <contact@thierryberger.com> | 2024-09-03 21:48:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-03 21:48:10 +0200 |
| commit | 98f9199abc3044779627b859b14f84fff3a97623 (patch) | |
| tree | e082a17dccd0e40c1ecd91525280dbfcfd6e951d /scripts | |
| parent | 58785ce257367f9e016738c2a87413b0590cc67f (diff) | |
| download | rapier-98f9199abc3044779627b859b14f84fff3a97623.tar.gz rapier-98f9199abc3044779627b859b14f84fff3a97623.tar.bz2 rapier-98f9199abc3044779627b859b14f84fff3a97623.zip | |
chore: add publish script for urdf and stl + unify all releases by de… (#727)
* chore: add publish script for urdf and stl + unify all releases by default
* better cross platform publish support
* publish in dry run within ci
* publish scripts better errors, abort if a publish fails, with an exit code.
* chore(rapier_urdf): fix warnings
* chore(rapier-urdf): typo fix
---------
Co-authored-by: Sébastien Crozet <developer@crozet.re>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/publish-extra-formats.sh | 11 | ||||
| -rwxr-xr-x | scripts/publish-rapier.sh | 35 | ||||
| -rwxr-xr-x | scripts/publish-testbeds.sh | 34 |
3 files changed, 80 insertions, 0 deletions
diff --git a/scripts/publish-extra-formats.sh b/scripts/publish-extra-formats.sh new file mode 100755 index 0000000..1d9a990 --- /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 || exit 1 +cd "$currdir" || exit 2 + +### Publish rapier3d-urdf. +cd "crates/rapier3d-urdf" && cargo publish $DRY_RUN || exit 1 +cd "$currdir" || exit 2
\ No newline at end of file diff --git a/scripts/publish-rapier.sh b/scripts/publish-rapier.sh new file mode 100755 index 0000000..8a1ab14 --- /dev/null +++ b/scripts/publish-rapier.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +tmp=$(mktemp -d) + +echo "$tmp" + +cp -r src "$tmp"/. +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 $DRY_RUN || exit 1 +cd "$currdir" || exit 2 + + +### 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 $DRY_RUN || exit 1 +cd "$currdir" || exit 2 + +### Publish the 2D f64 version. +sed 's#\.\./\.\./src#src#g' crates/rapier2d-f64/Cargo.toml > "$tmp"/Cargo.toml +currdir=$(pwd) +cd "$tmp" && cargo publish $DRY_RUN || exit 1 +cd "$currdir" || exit 2 + + +### 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 $DRY_RUN || exit 1 + +rm -rf "$tmp"
\ No newline at end of file diff --git a/scripts/publish-testbeds.sh b/scripts/publish-testbeds.sh new file mode 100755 index 0000000..92124fd --- /dev/null +++ b/scripts/publish-testbeds.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +gsed -v >> /dev/null +if [ $? == 0 ]; then + gsed=gsed +else + # Hopefully installed sed is the gnu one. + gsed=sed +fi + +tmp=$(mktemp -d) + +echo "$tmp" + +cp -r src "$tmp"/. +cp -r src_testbed "$tmp"/. +cp -r crates "$tmp"/. +cp -r LICENSE README.md "$tmp"/. + +### Publish the 2D version. +$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 $DRY_RUN +cd "$currdir" || exit + + +### Publish the 3D version. +$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 $DRY_RUN + +rm -rf "$tmp" |
