forked from martinpitt/python-dbusmock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo-release
executable file
·40 lines (31 loc) · 967 Bytes
/
do-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
#!/bin/sh
set -e
# This script does all the steps necessary for doing a new upstream release. It
# should solely be used by upstream developers, distributors do not need to
# worry about it.
[ -z "`git status -s`" ] || {
echo "Uncommitted changes, aborting" >&2
exit 1
}
# tests must succeed for Python 2 and 3
./setup.py test
python setup.py test
git clean -fdx
# update version in NEWS
version=$(grep '(UNRELEASED)' NEWS | cut -f1 -d' ')
[ -n "$version" ] || {
echo "no UNRELEASED in NEWS" >&2
exit 1
}
sed -i "s/(UNRELEASED)/$(date '+(%Y-%m-%d)')/" NEWS
# update version in package
sed -i -r "s/__version__ = '[0-9.]*'/__version__ = '${version}'/" dbusmock/__init__.py
# commit release
git add NEWS dbusmock/__init__.py
git commit -m "release $version"
git tag -s "$version"
# upload to PyPI and Launchpad
./setup.py sdist upload
lp-project-upload python-dbusmock "$version" "dist/python-dbusmock-$version.tar.gz"
git push
git push --tags