summaryrefslogtreecommitdiff
path: root/do_release
blob: e8c0d9118e327ef9420777b8e692c38ded4bb5fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#
#  Release the specified version.

if [ "$#" -ne 1 ]; then
	echo "usage: ${0##*/} [VERSION]"
	exit 1
fi

if [ "$( git status --porcelain | wc -c)" -ne 0 ]; then
	echo "ERROR: Outstanding local changes from git."
	exit 1
fi

VERSION="$1"

if [ -f /tmp/python-memcached-"$VERSION".tar.gz ]; then
	echo "ERROR: Release files already in /tmp"
	exit 1
fi

sed -ri 's/^(\s*__version__\s*=\s*).*$/\1"'"$VERSION"'"/' memcache.py
sed -ri 's/^(\sVersion:\s*).*$/\1"'"$VERSION"'"/' PKG-INFO

git tag -s "$VERSION"
git push
git push --tags

cd /tmp
release "$VERSION" python-memcached
cd python-memcached-"$VERSION"
python setup.py sdist bdist_wheel upload