From 5f6d1df70d789ca8cbcabdabcce6c8f68520690b Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 5 Oct 2017 17:02:32 +0200 Subject: [PATCH] Add makerelease script --- makerelease | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 makerelease diff --git a/makerelease b/makerelease new file mode 100755 index 0000000..4f5f33e --- /dev/null +++ b/makerelease @@ -0,0 +1,48 @@ +#!/bin/bash + +if [ "$1" == "" ]; then + echo "Error: No version provided" + echo "./makerelease 0.0.1" + exit 1 +fi + +ssh -T git@github.com +if [ ! "$?" = "1" ]; then + echo "No Github ssh key loaded exiting..." + exit 1 +fi + +clear +branch=$(git rev-parse --abbrev-ref HEAD) +read -p "Current branch is $branch. Continue ? (y/N)" choice +case "$choice" in + n|N|'' ) + echo "Cancel !" + exit 1 + ;; + y|Y ) echo "Make release...";; + * ) + echo "Cancel !" + exit 1 + ;; +esac + + + +# Ready to update : + +version=$1 + +sed -i "/\"version\":/c\ \ \"version\": \"$version\"," src/manifest.json + +git commit -m "Version $version" makefile src/* +git push + +git checkout master +git merge develop +git push + +git tag -a "v$version" -m "Version $version" +git push --tags + +git checkout $branch