2019-03-18 04:01:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-03-21 14:02:55 +00:00
|
|
|
local=false && [ "$1" = "local" ] && local=true
|
|
|
|
|
2019-03-18 04:01:29 +00:00
|
|
|
[ -f conserver/version.h ] || { echo "you are in the wrong place" ; exit 1; }
|
2019-03-24 16:59:46 +00:00
|
|
|
|
2019-03-30 02:56:14 +00:00
|
|
|
ver=`./gen-version number`
|
2019-03-27 05:47:00 +00:00
|
|
|
|
2019-03-27 06:27:08 +00:00
|
|
|
if ! $local; then
|
|
|
|
echo "Ready to tag release v$ver (y/N)?"
|
|
|
|
read i
|
|
|
|
if [ "$i" = "y" ]; then
|
|
|
|
echo "Adding git tag v$ver"
|
|
|
|
git tag -a -m "Release $ver" v$ver
|
|
|
|
fi
|
2019-03-27 05:47:00 +00:00
|
|
|
fi
|
|
|
|
|
2019-03-21 14:02:55 +00:00
|
|
|
if [ ! -f ../conserver-$ver.tar.gz ] || $local; then
|
2019-03-18 04:01:29 +00:00
|
|
|
(
|
|
|
|
[ -d build ] && rm -rf build
|
|
|
|
mkdir build
|
2019-03-27 06:27:08 +00:00
|
|
|
archtag=v$ver
|
|
|
|
$local && archtag=HEAD
|
|
|
|
git archive --format=tar.gz --prefix=conserver-$ver/ $archtag | (cd build; tar zxf -)
|
2019-03-19 05:17:24 +00:00
|
|
|
cd build/conserver-$ver
|
2019-03-19 14:46:40 +00:00
|
|
|
../../package/setup-configure
|
2019-03-19 05:17:24 +00:00
|
|
|
rm -rf package
|
2019-03-24 18:01:50 +00:00
|
|
|
sed -i "" -e "/^%define ver/s| ver.*| ver $ver|" contrib/redhat-rpm/conserver.spec
|
|
|
|
sed -i "" -e "/^VERSION=/s|.*|VERSION=\"$ver\"|" contrib/solaris-package/pkginfo
|
2019-03-18 04:01:29 +00:00
|
|
|
)
|
2019-03-21 14:02:55 +00:00
|
|
|
$local && exit
|
|
|
|
echo "Creating ../conserver-$ver.tar.gz"
|
2019-03-18 04:01:29 +00:00
|
|
|
tar zcf ../conserver-$ver.tar.gz -C build conserver-$ver
|
|
|
|
rm -rf build
|
|
|
|
|
|
|
|
[ -f ../conserver-$ver.tar.gz.asc ] && rm ../conserver-$ver.tar.gz.asc
|
|
|
|
fi
|
|
|
|
if [ ! -f ../conserver-$ver.tar.gz.asc ]; then
|
|
|
|
echo "Signing ../conserver-$ver.tar.gz"
|
|
|
|
gpg -ab --local-user bryan@conserver.com ../conserver-$ver.tar.gz
|
|
|
|
fi
|
|
|
|
body="\`\`\`
|
|
|
|
`sed -ne '/^ver/,/^$/p' CHANGES | sed -e '/^$/,$d'`
|
|
|
|
\`\`\`"
|
|
|
|
|
|
|
|
ls -l ../conserver-$ver.tar.gz*
|
|
|
|
echo "Ready to push (y/N)?"
|
|
|
|
read i
|
|
|
|
if [ "$i" = "y" ]; then
|
2019-03-27 05:47:00 +00:00
|
|
|
git push --tags
|
2019-03-18 04:01:29 +00:00
|
|
|
githubrelease release conserver/conserver create --name conserver-$ver --body "$body" v$ver ../conserver-$ver.tar.gz*
|
|
|
|
echo You can publish this release on the website or with:
|
|
|
|
echo " "githubrelease release conserver/conserver publish v$ver
|
|
|
|
else
|
|
|
|
echo Ok, here is the command I would have used:
|
2019-03-27 05:47:00 +00:00
|
|
|
echo " "git push --tags
|
2019-03-18 04:01:29 +00:00
|
|
|
echo " "githubrelease release conserver/conserver create --name conserver-$ver --body \""$body"\" v$ver ../conserver-$ver.tar.gz*
|
|
|
|
fi
|