diff --git a/graftm/version.py b/graftm/version.py index 6d50034..db3889a 100644 --- a/graftm/version.py +++ b/graftm/version.py @@ -1,2 +1,2 @@ -__version__ = "0.14.0" +__version__ = "0.15.0" diff --git a/release.py b/release.py new file mode 100755 index 0000000..c4376a2 --- /dev/null +++ b/release.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +import io +from os.path import dirname, join +import extern + + +def get_version(relpath): + """Read version info from a file without importing it""" + for line in io.open(join(dirname(__file__), relpath), encoding="cp437"): + if "__version__" in line: + if '"' in line: + return line.split('"')[1] + elif "'" in line: + return line.split("'")[1] + + +if __name__ == "__main__": + version = get_version('graftm/version.py') + print("version is {}".format(version)) + + # print("building docs") + # extern.run("python3 build_docs.py") + + print( + "Checking if repo is clean. If this fails it might be because the docs have changed from the previous command here?" + ) + extern.run('if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then exit 1; fi') + + extern.run('git tag v{}'.format(version)) + print("Now run 'git push && git push --tags' and GitHub actions will build and upload to PyPI".format(version)) + print('You have to run ./build.sh from the docker directory to build the docker image, once the tag is on GitHub')