ReaderforSelfoss/build.sh

32 lines
750 B
Bash
Raw Normal View History

2018-05-25 20:22:32 +00:00
#!/bin/bash
2018-11-13 20:57:36 +00:00
git fetch --tags -p
2018-10-14 13:59:02 +00:00
BASE_VERSION="1.7"
2018-11-13 19:24:06 +00:00
LAST_TAG=$(git tag -l | sort -V | tail -1)
2018-05-25 20:22:32 +00:00
2018-11-13 19:24:06 +00:00
INITIAL_VERSION="${BASE_VERSION//./}$(date '+%y%m%j')"
2018-05-25 20:22:32 +00:00
2018-11-13 19:24:06 +00:00
LAST_DAY_VERSION=$(echo $LAST_TAG | sed "s/v${INITIAL_VERSION}//")
LAST_DAY_VERSION_LENGTH=$(echo "${#LAST_DAY_VERSION}")
if [[ "$LAST_DAY_VERSION_LENGTH" == "1" ]]
then
TODAYS_VERSION=$(( $LAST_DAY_VERSION + 1 ))
else
TODAYS_VERSION="1"
fi
VERSION="${INITIAL_VERSION}${TODAYS_VERSION}"
2018-11-13 20:47:12 +00:00
PARAMS_EXCEPT_PUBLISH=$(echo $1 | sed 's/\-\-publish//')
2018-11-13 21:01:41 +00:00
./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH}
2018-10-14 13:57:22 +00:00
2018-11-13 20:45:10 +00:00
if [[ "$@" == *'--publish'* ]]
2018-10-14 13:57:22 +00:00
then
./publish-version.sh ${VERSION}
else
2018-11-13 19:24:06 +00:00
echo "Did not publish. If you wanted to do so, call the script with \"--publish\" or \"--publish-local\"."
2018-10-14 13:57:22 +00:00
fi