2016-06-14 05:39:17 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-06-28 14:50:21 +02:00
|
|
|
# Use passed argument as new tag
|
2016-10-28 13:02:13 +02:00
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
version=$(git describe --tags --abbrev=0)
|
|
|
|
patch=${version##*.}
|
|
|
|
set -- "${version%.*}.$((patch+1))"
|
|
|
|
fi
|
|
|
|
|
|
|
|
git tag "$@" || exit 1
|
2016-06-28 14:50:21 +02:00
|
|
|
|
2016-06-14 05:39:17 +02:00
|
|
|
# shellcheck disable=SC2016
|
2016-10-29 19:49:00 +02:00
|
|
|
tag_curr=$(git describe --tags --abbrev=0)
|
|
|
|
tag_curr_patch="${tag_curr##*.}"
|
|
|
|
tag_prev="${tag_curr%.*}.$((tag_curr_patch-1))"
|
2016-06-14 05:39:17 +02:00
|
|
|
|
2016-06-28 15:24:23 +02:00
|
|
|
./version.sh "$tag_curr"
|
|
|
|
|
2016-06-28 16:21:53 +02:00
|
|
|
sed -r "s/${tag_prev}/${tag_curr}/g" -i \
|
|
|
|
README.md CMakeLists.txt \
|
2016-11-19 06:22:44 +01:00
|
|
|
contrib/polybar.aur/PKGBUILD contrib/polybar.aur/.SRCINFO \
|
|
|
|
contrib/polybar-git.aur/PKGBUILD contrib/polybar-git.aur/.SRCINFO
|
2016-06-28 16:21:53 +02:00
|
|
|
|
|
|
|
git add -u README.md CMakeLists.txt \
|
2016-11-19 06:22:44 +01:00
|
|
|
contrib/polybar.aur/PKGBUILD contrib/polybar.aur/.SRCINFO \
|
|
|
|
contrib/polybar-git.aur/PKGBUILD contrib/polybar-git.aur/.SRCINFO \
|
2016-06-28 16:21:53 +02:00
|
|
|
include/version.hpp
|
|
|
|
|
2016-06-14 05:39:17 +02:00
|
|
|
git commit -m "build: Bump version to ${tag_curr}"
|
2016-06-28 14:50:21 +02:00
|
|
|
|
|
|
|
# Recreate the tag to include the last commit
|
|
|
|
[ $# -eq 1 ] && git tag -f "$@"
|