Created
January 19, 2019 16:23
-
-
Save JohannesBuchner/c03d89db101b2cbf79f4569645a846ef to your computer and use it in GitHub Desktop.
script for releasing packages on PyPI and publishing sphinx documentation on github pages
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
#!/bin/bash | |
# Author: Johannes Buchner (C) 2013 | |
# tool for publishing sphinx documentation on github | |
# and releasing packages on PyPI | |
case "$1" in | |
doc) | |
# see https://help.github.com/articles/creating-project-pages-manually | |
make -C doc/ html && | |
git checkout gh-pages && | |
cp -r doc/_build/html/* . && | |
git add $(ls *.html *.js objects.inv) $(ls -d _images/ _sources/ _static/ _modules/) && | |
git commit -v *.html *.js objects.inv $(ls -d _images/ _sources/ _static/ _modules/) && | |
git checkout master | |
;; | |
push) | |
git push origin gh-pages && | |
git push origin master | |
;; | |
release) | |
# see http://docs.python.org/2/distutils/packageindex.html | |
rm -rv build/ dist/ | |
python setup.py clean build install --user sdist bdist_wheel upload --sign | |
;; | |
*) | |
echo "error: unknown command '$1'" | |
echo "SYNOPSIS: $0 [ doc | push | release ]" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment