Add makerelase script

This commit is contained in:
MatMoul 2023-03-11 03:20:19 +01:00
parent cae4b73f19
commit c0539fa58a

46
makerelease Executable file
View File

@ -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}
git commit -m "Version ${version}" makefile src/*
git push
git checkout main
git merge dev
git push
git tag -a "v${version}" -m "Version ${version}"
git push --tags
git checkout "${branch}"