weblate/scripts/prepare-release
Michal Čihař efc23138fd Better headline for not released changelog
Signed-off-by: Michal Čihař <michal@cihar.com>
2019-06-28 13:07:37 +02:00

18 lines
784 B
Bash
Executable file

#!/bin/sh
set -e
if ! git diff --exit-code --quiet ; then
echo "There are not committed changes!"
exit 1
fi
version=$(DJANGO_SETTINGS_MODULE=weblate.settings_example python -c 'import weblate; print(weblate.VERSION_BASE)')
today=$(DJANGO_SETTINGS_MODULE=weblate.settings_example ./manage.py shell -c 'from django.utils.dateformat import format; import datetime; print(format(datetime.date.today(), "F dS Y"))')
sed -i "s/^VERSION =.*/VERSION = '$version'/" weblate/__init__.py
sed -i "s/weblate-[0-9.]\\+/weblate-$version/" docs/admin/deployments.rst
sed -i "s/^Not yet released./Released on $today./" docs/changes.rst
if ! git diff --exit-code --quiet ; then
git commit -s -m "Releasing $version" -- weblate/__init__.py docs/admin/deployments.rst docs/changes.rst
fi