forked from ameily/pypsi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkrelease.sh
executable file
·57 lines (46 loc) · 1.18 KB
/
mkrelease.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
if [ $# -eq 0 ];
then
echo "usage: $0 version [release]"
echo
echo "Example:"
echo " $0 1.2 1.2-rc2"
exit 1
fi
VERSION="$1"
if [ $# -eq 2 ];
then
RELEASE="$2"
else
RELEASE="$1"
fi
BEFORE=`md5sum pypsi/release.py`
cat > pypsi/release.py <<EOF
#
# This file is auto generated and will be overwritten, do not edit this file.
#
__version__ = "$VERSION"
__release__ = "$RELEASE"
EOF
AFTER=`md5sum pypsi/release.py`
echo "==================== Tagging Git ========================="
if [ "$BEFORE" = "$AFTER" ];
then
git add pypsi/release.py
git commit -m "updated to v$RELEASE"
fi
git tag --sign --message "tagged v$RELEASE" "v$RELEASE"
git push origin --tags
echo "=========================================================="
echo
set -e
echo "==================== Building Release ===================="
python setup.py sdist bdist_wheel upload --sign
echo "=========================================================="
echo
echo "==================== Building Docs ======================="
make -C docs/ clean
make -C docs/ html
pushd docs/build/html
zip -r "../../../pypsi_docs-$RELEASE.zip" *
popd
echo "=========================================================="