Skip to content

Commit

Permalink
helper release script
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 19, 2019
1 parent 4663819 commit fb041b9
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -10,7 +10,6 @@ dist
build
eggs
parts
bin
var
sdist
develop-eggs
Expand Down
1 change: 1 addition & 0 deletions __version__
@@ -0,0 +1 @@
2.4.0
28 changes: 28 additions & 0 deletions bin/release
@@ -0,0 +1,28 @@
#!/bin/bash -ex

VERSION="$1"
VERSION_FILE=__version__

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!"
4 changes: 3 additions & 1 deletion setup.py
Expand Up @@ -7,9 +7,11 @@
from setuptools import setup


VERSION = open('__version__').read()

setup(
name='Flask-Migrate',
version='2.4.0',
version=VERSION,
url='http://github.com/miguelgrinberg/flask-migrate/',
license='MIT',
author='Miguel Grinberg',
Expand Down

0 comments on commit fb041b9

Please sign in to comment.