Skip to content

Commit

Permalink
chore: add publish script for urdf and stl + unify all releases by de…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
Vrixyz committed Sep 2, 2024
1 parent 983f8a3 commit 0fb34df
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
14 changes: 14 additions & 0 deletions publish-all.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions scripts/publish-extra-formats.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions publish.sh → scripts/publish-rapier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions publish-testbeds.sh → scripts/publish-testbeds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ 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


### 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
cd "$tmp" && cargo publish $DRY_RUN

rm -rf "$tmp"

0 comments on commit 0fb34df

Please sign in to comment.