release.sh 1.32 KB
Newer Older
1
#!/usr/bin/env bash
Romain Bignon's avatar
Romain Bignon committed
2
# This script is used to release a version.
3
set -e
Romain Bignon's avatar
Romain Bignon committed
4

5 6
cd "$(dirname $0)/.."

Romain Bignon's avatar
Romain Bignon committed
7
function set_version {
8
	echo -n "Replacing version in source files to $1... "
9
	sed -i "s/^\(\s*\)\(VERSION\|version\|release\|__version__\)\( *\)=\( *\)[\"'][0-9]\+\..\+[\"']\(,\?\)$/\1\2\3=\4'$1'\5/g" $(git ls-files -x contrib | grep -v "\.svg$")
10
	echo -e "done.\n"
Romain Bignon's avatar
Romain Bignon committed
11 12
}

13
if [ -z "$1" ]; then
Romain Bignon's avatar
Romain Bignon committed
14 15 16 17 18 19
	echo "Syntax: $0 VERSION"
	exit 1
fi

VERSION=$1

20 21
echo "Generating ChangeLog..."

22
export LANG=en_US.utf8
Romain Bignon's avatar
Romain Bignon committed
23
mv ChangeLog ChangeLog.old
24
tools/release.py prepare $VERSION > ChangeLog
25
echo -e "\n" >> ChangeLog
Romain Bignon's avatar
Romain Bignon committed
26 27 28 29 30 31 32
cat ChangeLog.old >> ChangeLog
rm -f ChangeLog.old

vi +2 ChangeLog

set_version $VERSION

33
echo "Building Qt applications..."
34
./setup.py --qt sdist bdist clean -a || exit 1
35

36
echo "Generating manpages..."
37
tools/make_man.sh
38 39
echo -e "done!\n"

40 41 42
# in case there are new manpages not included in the git tree.
git add man/*

Romain Bignon's avatar
Romain Bignon committed
43 44 45 46 47 48 49 50
echo "Release commit:"
git commit -a -m "Weboob $VERSION released"
echo -ne "\n"

echo "Release tag:"
git tag $VERSION -s -m "Weboob $VERSION"
echo -ne "\n"

51
tools/release.py tarball $VERSION
Romain Bignon's avatar
Romain Bignon committed
52 53 54 55 56 57 58 59 60 61

echo -ne "\nDo you want to change the version number (y/n) "
read change_version

if [ "$change_version" = "y" ]; then
	echo -n "Enter the new version number: "
	read NEW_VERSION
	set_version $NEW_VERSION
	git commit -a -m "bump to $NEW_VERSION"
fi