From 0306eae92e63884d28b5545e4db563e35f6788f9 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 6 Sep 2015 17:25:54 +0200 Subject: [PATCH] Add makerelease script --- makerelease | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 makerelease diff --git a/makerelease b/makerelease new file mode 100644 index 0000000..005d005 --- /dev/null +++ b/makerelease @@ -0,0 +1,82 @@ +#!/bin/bash + +prjname=plasma-containmentactions-customdesktopmenu +version=$(date +"%Y.%m.%d.%H.%M.%S") +branch=$(git rev-parse --abbrev-ref HEAD) + +ssh -T git@github.com +if [ ! "$?" = "1" ]; then + echo "No Github ssh key loaded exiting..." + exit 1 +fi + +#scp "matmoul@web.sourceforge.net:/home/frs/project/$prjname/README.txt" /dev/null +#if [ ! "$?" = "0" ]; then +# echo "No Sourceforge ssh key loaded exiting..." +# exit 1 +#fi + +clear +read -p "Current branch is $branch. Continue ? (y/N)" choice +case "$choice" in + n|N|'' ) + echo "cancel build !" + exit 1 + ;; + y|Y ) echo "Begin Build Release...";; + * ) + echo "cancel build !" + exit 1 + ;; +esac +echo "Building version $version..." +echo "" + +echo "Finalise lib script..." +sed -i /X-KDE-PluginInfo-Version/c\X-KDE-PluginInfo-Version=$version src/plasma-containmentactions-customdesktopmenu.desktop + +echo "Make tar.gz file" +cp -R src plasma-containmentactions-customdesktopmenu +tar -zcvf releases/plasma-containmentactions-customdesktopmenu-$version.tar.gz plasma-containmentactions-customdesktopmenu/* +rm -R plasma-containmentactions-customdesktopmenu + +echo "Make last commit..." +git commit -a -m "New Release : $version" + +if [ ! "$branch" = "master" ]; then + echo "Merge branch $branch to master..." + git checkout master + git merge $branch + + read -p "Delete branch $branch ? (y/N)" choice + case "$choice" in + y|Y ) + git branch -D $branch + ;; + esac +fi + +read -p "Publish to server ? (Y/n)" choice +case "$choice" in + n|N ) + exit 1 + ;; +esac + +echo "Push release..." +git push + + + +#Sourceforge : + +echo "Publish release..." +scp -r releases/plasma-containmentactions-customdesktopmenu-$version.tar.gz matmoul@web.sourceforge.net:/home/frs/project/plasma-custom-desktop-menu/releases/ + + + + + +if [ ! "$branch" = "master" ]; then + git checkout $branch +fi