From 5a308ba6abe5144b26170ae5d1584a2c20ccc5d7 Mon Sep 17 00:00:00 2001 From: Ivan Nikulin Date: Thu, 12 Nov 2020 13:08:13 +0000 Subject: [PATCH] Add publish script --- scripts/publish.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 scripts/publish.sh diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100755 index 00000000..de890bb0 --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +set -euo pipefail + +SCRIPT_NAME=$(basename "$0") +REQUIRE_BRANCH='master' +CURRENT_BRANCH="$(git symbolic-ref --short HEAD)" + +if [[ "$CURRENT_BRANCH" != "$REQUIRE_BRANCH" ]]; then + echo "Please \`git checkout $REQUIRE_BRANCH\` to run $SCRIPT_NAME (cannot run from current branch $CURRENT_BRANCH)." + exit 1 +fi + +if [[ "$(git diff --stat)" != '' ]]; then + echo 'Please commit or discard your changes before creating a new release.' + exit 1 +fi + +echo "=== Publishing boring-sys... ===" +(cd boring-sys && cargo publish) +sleep 20 + +echo "=== Publishing boring... ===" +(cd boring && cargo publish) +sleep 20 + +echo "=== Publishing tokio-boring... ===" +(cd tokio-boring && cargo publish) +sleep 20 + +echo "=== Publishing hyper-boring... ===" +(cd hyper-boring && cargo publish) +sleep 20 \ No newline at end of file