diff --git a/etc/crate-release.sh b/etc/crate-release.sh new file mode 100755 index 000000000..69da84bc0 --- /dev/null +++ b/etc/crate-release.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# check we're in the grin root +if [ ! -f "LICENSE" ] ; then + echo "Script must be run from Grin's root directory" + exit 1 +fi + +echo "Going to package and publish each crate, if you're not logged in crates.io (missing ~/.cargo/credentials, this will fail." +echo "Also check that rust-secp256k1-zkp has been published with the latest version. " + +read -p "Continue? " -n 1 -r +if [[ ! $REPLY =~ ^[Yy]$ ]] +then + printf "\nbye\n" + exit 1 +fi + +echo +crates=( util keychain core store chain pool p2p api wallet config servers ) + +for crate in "${crates[@]}" +do + echo "** Publishing $crate" + cd $crate + cargo package + cargo pubish + cd .. +done + +echo "Done."