arch-pkgbuilder/makerelease.sh

40 lines
692 B
Bash
Raw Normal View History

2024-03-16 21:56:56 +00:00
#!/bin/bash
declare -r VERSION=${1}
declare -r MESSAGE=${2}
declare -r TAGBRANCH=main
declare CURRENTBRANCH=""
showHelp() {
echo git-release version
}
if [ "${VERSION}" == "" ]; then
showHelp
echo ""
echo "no version provided!"
exit 1
fi
2024-04-07 02:24:17 +00:00
ssh -T gitea@ssh.git.netm.ch
2024-03-16 21:56:56 +00:00
if [ ! "${?}" = "1" ]; then
2024-04-07 02:24:17 +00:00
echo "No ssh key loaded exiting..."
2024-03-16 21:56:56 +00:00
exit 1
fi
CURRENTBRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ ! "${CURRENTBRANCH}" == "dev" ]; then
echo "You are not in dev branch!"
echo "Use dev branch to make a release!"
exit 1
fi
git checkout "${TAGBRANCH}"
git merge "${CURRENTBRANCH}"
git push
git tag -a "${VERSION}" -m "${MESSAGE}"
git push --tags
git checkout "${CURRENTBRANCH}"