ReaderforSelfoss/build.sh

34 lines
911 B
Bash
Raw Normal View History

2018-05-25 20:22:32 +00:00
#!/bin/bash
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}"
PARAMS_EXCEPT_PUBLISH_LOCAL=$(echo $1 | sed 's/\-\-publish\-local//')
PARAMS_EXCEPT_PUBLISH=$(echo $PARAMS_EXCEPT_PUBLISH_LOCAL | sed 's/\-\-publish//')
./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH}
2018-10-14 13:57:22 +00:00
2018-11-13 19:24:06 +00:00
if [[ "$@" == *'--publish-local'* ]]
then
./publish-version-local.sh ${VERSION}
elif [[ "$@" == *'--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