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
|
#!/usr/bin/env bash
VERSION=$1
[ -z "$VERSION" ] && exit 1
OS=`uname`
SED_ARG='-r'
if [ $OS == "Darwin" ]
then
SED_ARG='-E'
fi
cd docs/swagger && ./set-version $VERSION && cd ../..
if [ $? == 0 ]
then
sed $SED_ARG "s/AC_INIT\(\[wforce\],(.*)/AC_INIT([wforce], [$VERSION])/" configure.ac >configure.tmp
if [ $? == 0 ]
then
mv configure.tmp configure.ac
read -r -p "Do you want to tag this release in git? [y/N] " response
if [[ $response =~ ^([yY])$ ]]
then
SIGN=""
read -r -p "Do you want to sign the tag? [y/N] " response
if [[ $response =~ ^([yY])$ ]]
then
SIGN="--sign"
fi
git add -u
git commit -m "Set version $VERSION and tagged as v$VERSION"
git tag -a v$VERSION -m "v$VERSION" $SIGN
echo "Tagged this commit as v$VERSION"
fi
fi
fi
|