forked from mjsull/DiscoPlot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdo_release.sh
executable file
·85 lines (72 loc) · 2.04 KB
/
do_release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Release script
# Copyright (C) 2013-2015 Mitchell Jon Stanton-Cook
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# School of Chemistry & Molecular Biosciences
# The University of Queensland
# Brisbane, QLD 4072.
# Australia
#VERSION=1.0.2
# Perform an install-uninstall cycle
pip uninstall DiscoPlot
python setup.py install
pip uninstall DiscoPlot
python setup.py clean
# Do all the versioning stuff here..
bumpversion patch
# Clean, test, build the source distribution & pip install it
# Need to get exit statuses here...
python setup.py clean
#python setup.py test
#STATUS=`echo $?`
#if [ $STATUS -eq 0 ]; then
# echo ""
#else
# echo "Tests failed. Will not release"
# exit
#fi
python setup.py sdist bdist_wheel
pip install dist/DiscoPlot-$VERSION.tar.gz
STATUS=`echo $?`
if [ $STATUS -eq 0 ]; then
echo ""
else
echo "Package is not pip installable. Will not release"
exit
fi
# Docs
# Need to get exit statuses here...
cd docs
make clean
sphinx-apidoc -o API ../DiscoPlot
mv API/* .
rmdir API
make html
cd ..
git push
# tag & push the tag to github
GIT=`git status`
CLEAN='# On branch master nothing to commit, working directory clean'
if [ "$s1" == "$s2" ]; then
git tag v$VERSION
git push --tags
else
echo "Git not clean. Will not release"
exit
fi
# Upload to PyPI & clean
twine upload -u mscook -p $PYPIPASS dist/* && python setup.py clean