forked from martinpitt/python-dbusmock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdo-release
More file actions
executable file
·33 lines (26 loc) · 901 Bytes
/
do-release
File metadata and controls
executable file
·33 lines (26 loc) · 901 Bytes
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
#!/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
}
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 and tag
git add NEWS dbusmock/__init__.py
git commit -m "release $version"
changes=$(grep --max-count=1 -A1000 '^------' NEWS | grep -v '^--------' | grep -B1000 --max-count=1 '^$')
printf "$version\n\n$changes\n" | git tag -s -F- $version
git push
git push --tags