2017-01-26 22:15:14 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
main() {
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
version=$(git describe --tags --abbrev=0)
|
2017-01-27 09:53:44 -05:00
|
|
|
set -- "${version%.*}.$((${version##*.}+1))"
|
2017-01-26 22:15:14 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
git tag "$@" || exit 1
|
|
|
|
|
|
|
|
tag_curr="$(git tag --sort=version:refname | tail -1)"
|
|
|
|
tag_prev="$(git tag --sort=version:refname | tail -2 | head -1)"
|
|
|
|
|
2017-01-27 09:53:44 -05:00
|
|
|
if [ -x ./common/version.sh ]; then
|
|
|
|
./common/version.sh "$tag_curr"
|
|
|
|
fi
|
2017-01-26 22:15:14 -05:00
|
|
|
|
|
|
|
sed -r "s/${tag_prev}/${tag_curr}/g" -i \
|
|
|
|
README.md CMakeLists.txt \
|
2017-12-03 18:35:30 -05:00
|
|
|
contrib/polybar.aur/PKGBUILD \
|
|
|
|
contrib/polybar-git.aur/PKGBUILD
|
2017-01-26 22:15:14 -05:00
|
|
|
|
|
|
|
git add -u README.md CMakeLists.txt \
|
2017-12-03 18:35:30 -05:00
|
|
|
contrib/polybar.aur/PKGBUILD \
|
|
|
|
contrib/polybar-git.aur/PKGBUILD \
|
2017-01-26 22:15:14 -05:00
|
|
|
include/version.hpp
|
|
|
|
|
|
|
|
git commit -m "build: Bump version to ${tag_curr}"
|
|
|
|
|
|
|
|
# Recreate the tag to include the last commit
|
|
|
|
[ $# -eq 1 ] && git tag -f "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|