Skip to content

Commit b58e375

Browse files
Jan WielemakerJan Wielemaker
Jan Wielemaker
authored and
Jan Wielemaker
committed
ADDED Official releases
1 parent 32ce5ba commit b58e375

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

scripts/newversion

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
# Automate the release process.
3+
# Author: Jan wielemaker
4+
#
5+
# Usage: first update VERSION, then run this script.
6+
7+
function confirm ()
8+
{ while true; do
9+
echo -n "$1 "
10+
read answer
11+
case "$answer" in
12+
y*) return 0
13+
;;
14+
n*) return 1
15+
;;
16+
*)
17+
echo "Please answer yes or no"
18+
;;
19+
esac
20+
done
21+
}
22+
23+
version=`cat VERSION`
24+
versiondate=`date +"%B %Y"`
25+
26+
vpat='\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(-\([a-z0-9]*\)\)\{0,1\}'
27+
28+
major=$(echo $version | sed "s/$vpat/\1/")
29+
minor=$(echo $version | sed "s/$vpat/\2/")
30+
patch=$(echo $version | sed "s/$vpat/\3/")
31+
vtag=$(echo $version | sed "s/$vpat/\5/")
32+
33+
# echo "major=$major minor=$minor patch=$patch tag=$vtag"
34+
# exit 0
35+
36+
numversion=$(($major * 10000 + $minor * 100 + $patch))
37+
38+
vlong=${major}.${minor}.${patch}
39+
if [ ! -z "$vtag" ]; then
40+
vlong="$vlong-$vtag"
41+
fi
42+
43+
if [ ! -z "$(git diff --stat)" ]; then
44+
if confirm "Commit final changes? "; then
45+
git commit -a -m "Preparing version ${vlong}"
46+
fi
47+
fi
48+
49+
gittag="V${vlong}"
50+
51+
if confirm "Tag the GIT repository with $gittag? "; then
52+
git tag -s -f -m "Release tag for ${vlong}" $gittag
53+
fi
54+
55+
56+
if confirm "Tag all packages with $gittag? "; then
57+
tmp=/tmp/msg$$
58+
echo "Release tag for ${vlong}" > $tmp
59+
60+
git submodule foreach git tag -s -f -F $tmp $gittag
61+
62+
rm -f $tmp
63+
fi
64+

0 commit comments

Comments
 (0)