#!/bin/bash

# Tool to make releasing painless
# usage: ./release x.y.z
# where x.y.z is the version number to release to

NEW_VERSION=$1

# bump the version number in notedown/main.py
sed -i -e "s/version=.*,/version="'"'$NEW_VERSION'"'",/" setup.py &&

# upload to pypi
python setup.py sdist bdist_wheel upload -r pypi &&

# commit the version bump
git add setup.py &&
git commit -m "release $NEW_VERSION" &&

# git tag the release
git tag rel-$NEW_VERSION
