Last active
August 20, 2020 12:37
-
-
Save wyllie/63c7050cc3c5d7808f0febd40a6c14f1 to your computer and use it in GitHub Desktop.
python bumpversion and tag/create new github release
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Quick little script that bumps the release version using `bump2version` | |
# and then creates a release using the github `hub` tool | |
# I added bump2version to the project's requirements.txt file | |
usage() { | |
echo "Usage: $0 [major|minor|patch]" 1>&2 | |
} | |
options=('major' 'minor' 'patch') | |
if [[ " ${options[@]} " =~ " $1 " ]]; then | |
if [ -x /usr/local/bin/hub ]; then | |
echo Current Version: v$(python setup.py --version) | |
bumpversion $1 | |
VERSION=v$(python setup.py --version) | |
echo New Version: $VERSION | |
git push | |
hub release create $VERSION | |
fi | |
else | |
usage | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment