Release automation.
This commit is contained in:
parent
664bd3e23f
commit
c92b9541a9
33
do_release
Executable file
33
do_release
Executable 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
|
@ -2,16 +2,4 @@
|
||||
#
|
||||
# Run when the .tar file is created, updates the .spec file.
|
||||
|
||||
dir=`pwd`
|
||||
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
|
||||
# All done in "do_release" now.
|
||||
|
Loading…
Reference in New Issue
Block a user