2022-03-22 16:12:14 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
git fetch --tags -p
|
|
|
|
|
2022-09-07 18:24:19 +00:00
|
|
|
BASE_VERSION="1"
|
2022-03-22 16:12:14 +00:00
|
|
|
LAST_TAG=$(git tag -l | sort -V | tail -1)
|
|
|
|
|
|
|
|
INITIAL_VERSION="${BASE_VERSION//./}$(date '+%y%m%j')"
|
|
|
|
|
|
|
|
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=$(echo $1 | sed 's/\-\-publish//')
|
|
|
|
|
2022-09-14 10:32:00 +00:00
|
|
|
./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH} $@
|
2022-03-22 16:12:14 +00:00
|
|
|
|
|
|
|
if [[ "$@" == *'--publish'* ]]
|
|
|
|
then
|
2022-09-14 10:32:00 +00:00
|
|
|
./publish-version.sh ${VERSION} $@
|
2022-03-22 16:12:14 +00:00
|
|
|
else
|
|
|
|
echo "Did not publish. If you wanted to do so, call the script with \"--publish\" or \"--publish-local\"."
|
|
|
|
fi
|