ci: add automatic mechanism for determining next version number

This commit is contained in:
Travis Cross 2012-05-08 16:35:08 +00:00
parent ee8caf78f1
commit 42dab83966
3 changed files with 22 additions and 1 deletions

1
build/next-release.txt Normal file
View File

@ -0,0 +1 @@
1.2-rc3

View File

@ -7,7 +7,11 @@ sdir="."
check_pwd check_pwd
check_input_ver_build $@ check_input_ver_build $@
eval $(parse_version "$1") in_ver="$1"
if [ "$in_ver" = "auto" ]; then
in_ver="$(cat build/next-release.txt)"
fi
eval $(parse_version "$in_ver")
datestamp="$(date +%Y%m%dT%H%M%SZ)" datestamp="$(date +%Y%m%dT%H%M%SZ)"
nightly="n${datestamp}" nightly="n${datestamp}"
build="b${2-0}" build="b${2-0}"

View File

@ -114,6 +114,22 @@ if (ngrep '^Saved' "$ret"); then
stash_saved=1 stash_saved=1
fi fi
echo "Determining next-release (release+1) version..." >&2
if [ -n "$grev" ] && ngrep '[0-9]*$' "$grev"; then
rev_ver="$(echo "$grev" | sed -e 's/^[^0-9]*\([0-9]*\)$/\1/')"
next_rev="$((rev_ver+1))"
next_ver="${gver%%$rev_ver}${next_rev}"
elif [ -n "$grev" ]; then
next_ver="${gver}1"
elif ! [ "$gmicro" = "0" ]; then
next_ver="${gver%%$micro}$((micro+1))"
else
next_ver="${gmajor}.$((gminor+1))-rc1"
fi
echo "Setting next-release version ($next_ver)..." >&2
echo "${next_ver}" > build/next-release.txt
git add build/next-release.txt
echo "Changing the version of configure.in..." >&2 echo "Changing the version of configure.in..." >&2
set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev"