dokytree/makerelease

51 lines
820 B
Plaintext
Raw Normal View History

2023-03-11 02:20:19 +00:00
#!/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
2023-03-11 02:46:38 +00:00
declare BRANCH=""
BRANCH=$(git rev-parse --abbrev-ref HEAD)
read -r -p "Current branch is ${BRANCH}. Continue ? (y/N)" choice
2023-03-11 02:20:19 +00:00
case "${choice}" in
n|N|'' )
echo "Cancel !"
exit 1
;;
y|Y ) echo "Make release...";;
* )
echo "Cancel !"
exit 1
;;
esac
# Ready to update :
2023-03-11 02:46:38 +00:00
declare VERSION
VERSION=${1}
2023-03-11 02:20:19 +00:00
2023-03-11 02:46:38 +00:00
sed -i 's/pkgver=.*/pkgver='"${VERSION}"'/' packaging/archlinux/dokytree/PKGBUILD
git commit -a -m "Version ${VERSION}"
2023-03-11 02:20:19 +00:00
git push
git checkout main
git merge dev
git push
2023-03-11 02:46:38 +00:00
git tag -a "v${VERSION}" -m "Version ${VERSION}"
2023-03-11 02:20:19 +00:00
git push --tags
2023-03-11 02:48:20 +00:00
git checkout "${BRANCH}"