-
Notifications
You must be signed in to change notification settings - Fork 20
/
new-kdev4-release.sh
executable file
·71 lines (59 loc) · 1.9 KB
/
new-kdev4-release.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
#!/bin/bash
# assumes format vMAJOR.MINOR.PATCH or similar
if [[ "$1" == "" || "$2" == "" ]]; then
echo "newrelease.sh TAG_RELEASE TAG_LASTRELEASE [i18n branch]"
echo " example: newrelease.sh v1.0.1 v1.0.0"
echo " example: newrelease.sh v4.2.80 v4.2.3 stable"
exit 1
fi
kdevelop_releasetag=$(echo $1 | awk -F '.' '{print "v" 4 "." $2 "." $3}')
kdevelop_lastreleasetag=$(echo $2 | awk -F '.' '{print "v" 4 "." $2 "." $3}')
kdevelop_version=$(echo $kdevelop_releasetag | awk '{print substr($1, 2)}')
releasetag=$(echo $1 | awk -F '.' '{print "v" 1 "." $2 "." $3}')
lastreleasetag=$(echo $2 | awk -F '.' '{print "v" 1 "." $2 "." $3}')
version=$(echo $releasetag | awk '{print substr($1, 2)}')
minor=${version/*./}
if [ "$minor" -gt "60" ]; then
# beta realease
i18nbranch=trunk
else
# stable release
i18nbranch=stable
fi
if [[ "$3" == "stable" || "$3" == "trunk" ]]; then
# overwrite i18n branch:
i18nbranch=$3
fi
echo "creating release for KDevplatform $version / KDevelop $kdevelop_version (i18n branch: $i18nbranch)"
echo -n "continue? [Y/n]"
read response
if [[ "$response" != "Y" && "$response" != "" ]]; then
echo "bye"
exit 2
fi
SRC=~/projects/kde4
cd $SRC/releaseme
for p in kdevplatform kdevelop kdev-php kdev-php-docs kdev-python kdev-python-py3; do
for p in kdev-python; do
suffix=
if [[ "$p" == "kdev-python-py3" ]]; then
suffix="-py3"
p="kdev-python"
fi
pushd . &> /dev/null
cd $SRC/$p
git fetch origin
if [[ "$p" == "kdevelop" ]]; then
v=$kdevelop_version
from=$kdevelop_lastreleasetag
to=$kdevelop_releasetag
else
v=$version$suffix
from=$lastreleasetag$suffix
to=$releasetag$suffix
fi
echo "creating release for $p version $v (branch is: $to / $i18nbranch)"
gitchangelog $from $to > /tmp/CHANGELOG.$v
popd &> /dev/null
./$p.rb --src ~/projects/kde4/$p/ --git-branch $to -b $i18nbranch -m 75 -p ssh -v $v -c /tmp/CHANGELOG.$v
done