-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbumpversion.sh
executable file
·82 lines (58 loc) · 1.4 KB
/
bumpversion.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
#!/bin/bash
set -e
# Quick and Dirty check about parameters
if [ $# -ne 1 ]; then
cat << EOF
Usage: $(basename $0) version
version:
the version number (eg: 1.0.0)
EOF
exit 1
fi
# Quick and Dirty check about the PWD
if [ $(dirname $(readlink -f $0)) != $PWD ]; then
cat << EOF
Please run the script from is root directory:
cd $(dirname $(readlink -f $0))
EOF
exit 1
fi
# Main
VERSION=$1
echo "Updating version..."
# setup
sed -i "s/version=.*/version='$VERSION',/" ./setup.py
# docs
sed -i "s/version = .*/version = '$VERSION'/" ./gendocs/conf.py
sed -i "s/release = .*/release = '$VERSION'/" ./gendocs/conf.py
# packaging
sed -i "s/pkgver=.*/pkgver='$VERSION'/" ./packaging/archlinux/PKGBUILD
sed -i "s/pkgrel=.*/pkgrel=1/" ./packaging/archlinux/PKGBUILD
# generate docs
echo "Generating docs..."
cd gendocs
make clean > /dev/null
make html > /dev/null
rsync -crv --delete --exclude=README.rst _build/html/ ../docs/ > /dev/null
cd ..
# git add
echo "Preparing git commit..."
git add .
# python module for pypi
echo "python module creation..."
if [ -d "./dist/" ]; then
rm -f ./dist/* > /dev/null
fi
python setup.py bdist_wheel > /dev/null
# NOTICE
cat << EOF
Please check that everything is fine by running :"
git diff HEAD
Once checked, please run :
git commit -m "Bump version: $VERSION"
git push origin master
git tag -m "$VERSION" $VERSION
git push origin $VERSION
# pypi
twine upload dist/*
EOF