From 1fd43a3fc86be8848fc6d70d80638db688f4eb97 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sun, 19 May 2019 18:42:16 +0100 Subject: [PATCH] helper release script --- .gitignore | 1 - bin/release | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 bin/release diff --git a/.gitignore b/.gitignore index ded6067..6d7373f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ dist build eggs parts -bin var sdist develop-eggs diff --git a/bin/release b/bin/release new file mode 100755 index 0000000..fbb6860 --- /dev/null +++ b/bin/release @@ -0,0 +1,28 @@ +#!/bin/bash -ex + +VERSION="$1" +VERSION_FILE=flask_socketio/__init__.py + +if [[ "$VERSION" == "" ]]; then + echo "Usage: $0 " +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!"