🔨 New script for publishing crates

This commit is contained in:
Manuel Cillero 2024-02-09 20:55:10 +01:00
parent fa66d628a0
commit 62b9f1e4e0

50
tools/publish.sh Executable file
View file

@ -0,0 +1,50 @@
#!/bin/bash
cd "$(dirname "$0")"
cd ..
if [ -n "$(git status --porcelain)" ]; then
echo "You have local changes!"
exit 1
fi
function publish_crate() {
echo -e "\nPublishing ${crate}"
cp ../LICENSE-MIT "$crate"
cp ../LICENSE-APACHE "$crate"
pushd "$crate"
git add LICENSE-MIT LICENSE-APACHE
# cargo publish --no-verify --allow-dirty
cargo publish
popd
sleep 20
}
# If package A depends on package B, B must come before A in this list
helpers=(
pagetop-macros
pagetop-build
)
packages=(
pagetop-bootsier
pagetop-bulmix
pagetop-homedemo
pagetop-user
pagetop-admin
pagetop-node
)
pushd helpers
for crate in "${helpers[@]}"; do publish_crate; done
popd
echo "Publishing root crate"
#cargo publish --allow-dirty
cargo publish
pushd packages
for crate in "${packages[@]}"; do publish_crate; done
popd
echo "Cleaning local state"
git reset HEAD --hard