From a43c89a2bdfd2c39bf043f9149b5d6b095afa771 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 25 Feb 2017 03:07:10 +0100 Subject: [PATCH] Add make release support --- makerelease | 46 ++++++++++++++++++++++++++++++++++++++++++++ src/helpers/help.cpp | 4 +++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 makerelease diff --git a/makerelease b/makerelease new file mode 100755 index 0000000..c5a3b6d --- /dev/null +++ b/makerelease @@ -0,0 +1,46 @@ +#!/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 "/string version = /c\\\tstring version = \"$version\";" src/helpers/help.cpp +git commit -m "Version $version" src/* +git push + +git tag -a "v$version" -m "Version $version" +git push --tags + +#wget https://github.com/MatMoul/g810-led/archive/v$version.zip +#wget https://github.com/MatMoul/g810-led/archive/v$version.tar.gz + +#Publish to aur... diff --git a/src/helpers/help.cpp b/src/helpers/help.cpp index 997a5b6..eb56b55 100644 --- a/src/helpers/help.cpp +++ b/src/helpers/help.cpp @@ -8,11 +8,13 @@ using namespace std; namespace help { + string version = "0.0.1"; void usage(char *arg0) { string cmdName = utils::getCmdName(arg0); cout<