Release automation.

This commit is contained in:
Sean Reifschneider 2015-07-31 14:10:22 -06:00
parent 664bd3e23f
commit c92b9541a9
3 changed files with 35 additions and 14 deletions

33
do_release Executable file
View File

@ -0,0 +1,33 @@
#!/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=).*$/\1"'"$VERSION"'",/' setup.py
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

View File

@ -2,16 +2,4 @@
# #
# Run when the .tar file is created, updates the .spec file. # Run when the .tar file is created, updates the .spec file.
dir=`pwd` # All done in "do_release" now.
rev=${dir##*-}
echo "Updating files to $rev"
sed --in-place 's/^Version: .*$/Version: '"$rev"/ PKG-INFO
sed --in-place 's/^__version__ .*$/__version__ = "'"$rev"'"/' memcache.py
pydoc -w ./memcache.py
rm -f releasescript.auto
python setup.py sdist bdist_wheel upload
rm -rf *.pyc dist python_memcached.egg-info

View File

@ -4,7 +4,7 @@ from setuptools import setup # noqa
setup(name="python-memcached", setup(name="python-memcached",
version="1.53", version="1.58",
description="Pure python memcached client", description="Pure python memcached client",
long_description=open("README.md").read(), long_description=open("README.md").read(),
author="Evan Martin", author="Evan Martin",