helper release script

This commit is contained in:
Miguel Grinberg 2019-05-19 18:42:16 +01:00
parent 686abcaf69
commit 1fd43a3fc8
No known key found for this signature in database
GPG Key ID: 36848B262DF5F06C
2 changed files with 28 additions and 1 deletions

1
.gitignore vendored
View File

@ -10,7 +10,6 @@ dist
build
eggs
parts
bin
var
sdist
develop-eggs

28
bin/release Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash -ex
VERSION="$1"
VERSION_FILE=flask_socketio/__init__.py
if [[ "$VERSION" == "" ]]; then
echo "Usage: $0 <version>"
fi
sed -i "" "s/^__version__ = '.*'$/__version__ = '$VERSION'/" $VERSION_FILE
rm -rf dist
pip install --upgrade pip wheel twine
python setup.py sdist bdist_wheel --universal
git add $VERSION_FILE
git commit -m "Release $VERSION"
git tag -f v$VERSION
git push --tags origin master
read -p "Press any key to submit to PyPI or Ctrl-C to abort..." -n1 -s
twine upload dist/*
NEW_VERSION="${VERSION%.*}.$((${VERSION##*.}+1))dev"
sed -i "" "s/^__version__ = '.*'$/__version__ = '$NEW_VERSION'/" $VERSION_FILE
git add $VERSION_FILE
git commit -m "Version $NEW_VERSION"
git push origin master
echo "Development is now open on version $NEW_VERSION!"