Script to increase the version for a new release

This script creates a new release, increasing the release number in all
files then it creates a new commit and the creates a new tag, and
finnaly it generates the .tar.xz release file.
This commit is contained in:
Daniel García Moreno 2017-12-27 12:45:37 +01:00
parent cfcb7091d4
commit 9104ebb223

29
scripts/new-release.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/bash
current=$(cat meson.build | grep -Eo "version: '(.*)'" | grep -Eo "[0-9]+\.[0-9]+.[0-9]+")
mayor=$(echo $current | cut -d"." -f1)
minor=$(echo $current | cut -d"." -f2)
rev=$(echo $current | cut -d"." -f3)
case $1 in
"mayor")
next=$(echo $(($mayor + 1)).0.0)
;;
"minor")
next=$(echo $mayor.$(($minor + 1)).0)
;;
*)
next=$(echo $mayor.$minor.$(($rev + 1)))
;;
esac
sed -i "s/$current/$next/" meson.build
sed -i "s/$current/$next/" fractal-gtk/Cargo.toml
sed -i "s/version=\"$current\".*/version=\"$next\" date=\"$(date +%Y-%m-%d)\"\/>/" fractal-gtk/res/org.gnome.Fractal.appdata.xml
git commit -av
git tag -s $next
make release
#git push --tags