mirror of
https://github.com/MatMoul/plasma-containmentactions-customdesktopmenu.git
synced 2024-12-23 14:36:12 +00:00
71 lines
1.6 KiB
Bash
Executable File
71 lines
1.6 KiB
Bash
Executable File
#!/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
|
|
|
|
scp "matmoul@web.sourceforge.net:/home/frs/project/plasma-custom-desktop-menu/README.txt" /dev/null
|
|
if [ ! "$?" = "0" ]; then
|
|
echo "No Sourceforge ssh key loaded exiting..."
|
|
exit 1
|
|
fi
|
|
|
|
clear
|
|
branch=$(git rev-parse --abbrev-ref HEAD)
|
|
version=$1
|
|
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 last commit..."
|
|
git commit -a -m "Version $version"
|
|
|
|
if [ ! "$branch" = "master" ]; then
|
|
echo "Merge branch $branch to master..."
|
|
git checkout master
|
|
git merge $branch
|
|
git push
|
|
fi
|
|
|
|
read -p "Publish to server ? (Y/n)" choice
|
|
case "$choice" in
|
|
n|N )
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
echo "Publish release..."
|
|
#Github
|
|
git tag -a "v${version}" -m "Version ${version}"
|
|
git push --tags
|
|
#Sourceforge :
|
|
wget https://github.com/MatMoul/plasma-containmentactions-customdesktopmenu/archive/v${version}.tar.gz
|
|
scp -r v${version}.tar.gz matmoul@web.sourceforge.net:/home/frs/project/plasma-custom-desktop-menu/releases/
|
|
rm v${version}.tar.gz
|
|
|
|
if [ ! "$branch" = "master" ]; then
|
|
git checkout $branch
|
|
fi
|