From e67f54c41140e6f93f96e478a298634cceec312e Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Mon, 29 Jan 2018 20:35:41 +0000 Subject: [PATCH] Add version & release script --- bin/aurto | 5 +++-- release | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 release diff --git a/bin/aurto b/bin/aurto index 60a13bf..b6ff0ef 100755 --- a/bin/aurto +++ b/bin/aurto @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -eu +version="0.1" command=${1:-} arg1=${2:-} @@ -22,7 +23,7 @@ elif [ "$command" == "remove" ] && [ -n "$arg1" ]; then echo -e "aurto: Removed \\e[36m$removed\\e[39m" >&2 fi else - echo -e "Simple management tool for the 'aurto' repository" - echo -e " Usage: \\e[32maurto add\\e[39m|\\e[32mremove \\e[36mPACKAGES\\e[39m" + echo -e "\\e[1maurto \\e[21mv$version: simple management tool for the 'aurto' repository" + echo -e " Usage: \\e[32maurto add\\e[39m|\\e[32mremove \\e[36mPACKAGES...\\e[39m" exit 1 fi diff --git a/release b/release new file mode 100755 index 0000000..81bc767 --- /dev/null +++ b/release @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -eu +dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$dir" + +tagname="v$(grep version= bin/aurto | cut -d'"' -f2)" +if git rev-parse "$tagname" >/dev/null 2>&1 +then + echo "tag $tagname already exists" >&2 + exit 1 +fi + +echo "Release $tagname" +read -p "continue? [y/N] " -n 1 -r +echo +if ! [[ $REPLY =~ ^[^Nn]$ ]]; then + exit 0 +fi + +git tag -s "$tagname" -m "Release $tagname" +git push --tags + +echo "Pushed tag $tagname to repo, ready to add notes" +gio open "https://github.com/alexheretic/aurto/releases/new?tag=$tagname"