Skip to content

Commit

Permalink
Add publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
inikulin committed Nov 12, 2020
1 parent 5afd10b commit 5a308ba
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5a308ba

Please sign in to comment.