forked from clueboard/milc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease
executable file
·57 lines (43 loc) · 1.06 KB
/
release
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
#!/bin/sh
# Increment the verison number and release a new version of MILC.
#
# Required packages are in requirements-release.txt
set -e
set -x
PYPI_USERNAME=${PYPI_USERNAME:=skully}
TWINE_USERNAME=$PYPI_USERNAME
export TWINE_USERNAME
# Install deps
python3 -m pip install --upgrade -r requirements-release.txt
# Make sure the tree is clean
if ! git status | grep 'working tree clean'; then
echo '*** Working tree is not clean!'
exit 1
fi
rm -f dist/*
# Make sure we're current with master
git pull --ff-only
# Generate the documentation
./generate_docs
if ! git status | grep 'working tree clean'; then
docs_good=1
for doc in docs/api*.md; do
if ! grep -q "$(basename $doc)" docs/_summary.md; then
echo "No _summary entry for ${doc}!"
docs_good=0
fi
done
if [ $docs_good -eq 0 ]; then
exit 2
fi
git add .
git commit -m"Generated API documentation."
fi
# Increment the version number
bumpversion patch
# Push our work up
git push origin master --tags
# Build our package
python3 setup.py sdist bdist_wheel
# Upload to pypi
twine upload dist/milc-*