weblate/scripts/create-release
Michal Čihař 6ebb07078b Handle -dev suffix on the release time
Issue #921

Signed-off-by: Michal Čihař <michal@cihar.com>
2015-11-10 14:52:16 +01:00

40 lines
1,001 B
Bash
Executable file

#!/bin/sh
set -e
if [ "x$1" = "x--help" -o "x$1" = "x-h" ] ; then
echo "Usage: ./scripts/create-release [--tag]"
exit 1
fi
if ! git diff --exit-code --quiet ; then
echo "There are not committed changes!"
exit 1
fi
# Grab version
version=`DJANGO_SETTINGS_MODULE=weblate.settings_example python -c 'import weblate; print weblate.VERSION_BASE'`
namever=weblate-$version
tarver=Weblate-$version
# What are we going to build?
if [ "x$1" = "x--tag" ] ; then
sed -i "s/^VERSION =.*/VERSION = '$version'/" weblate/__init__.py
if ! git diff --exit-code --quiet ; then
git commit -s -m "Releasing $version" -- weblate/__init__.py
fi
rev=$namever
git tag -s $rev -m "Version $version"
cd ../weblate-test
git tag -s $rev -m "Test data for version $version"
cd ../weblate
fi
# Compile po files
./scripts/generate-locales
# Create tarball
./setup.py sdist --formats bztar,gztar,zip
# Build tarballs
zcat dist/$tarver.tar.gz | xz > dist/$tarver.tar.xz