check_version chore improvements
This commit is contained in:
parent
48c39fda90
commit
ed0a671d9c
1 changed files with 21 additions and 6 deletions
|
@ -3,10 +3,25 @@
|
||||||
script="$( readlink -f "${0}" )"
|
script="$( readlink -f "${0}" )"
|
||||||
script_dir="$( dirname "${script}" )"
|
script_dir="$( dirname "${script}" )"
|
||||||
|
|
||||||
|
if [ "$( git rev-parse --abbrev-ref HEAD )" = "develop" ]; then
|
||||||
|
echo "Status: Developing"
|
||||||
|
# => version from most recent tag
|
||||||
|
git_version="$( \
|
||||||
|
git describe --tags --abbrev=0 \
|
||||||
|
| sed -E 's/^v[^0-9]*((0|[1-9][0-9]*)[0-9\.]*[0-9]).*$/\1/'
|
||||||
|
)"
|
||||||
|
elif git rev-parse --abbrev-ref HEAD | grep -E 'release|hotfix/' >/dev/null; then
|
||||||
|
echo "Status: Releasing"
|
||||||
|
# => version from releasing branch
|
||||||
git_version="$( \
|
git_version="$( \
|
||||||
git rev-parse --abbrev-ref HEAD \
|
git rev-parse --abbrev-ref HEAD \
|
||||||
| cut -d '/' -f 2
|
| cut -d '/' -f 2
|
||||||
)"
|
)"
|
||||||
|
else
|
||||||
|
echo "ERROR: Invalid git branch"
|
||||||
|
echo "ERROR: Chores cannot be run on '$( git rev-parse --abbrev-ref HEAD )'!"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
api_version="$( \
|
api_version="$( \
|
||||||
grep '^version' "${script_dir}/../../api/pyproject.toml" \
|
grep '^version' "${script_dir}/../../api/pyproject.toml" \
|
||||||
|
@ -14,8 +29,8 @@ api_version="$( \
|
||||||
)"
|
)"
|
||||||
|
|
||||||
ui_version="$( \
|
ui_version="$( \
|
||||||
python3 -c 'import sys, json; print(json.load(sys.stdin)["version"])' \
|
grep '"version":' "${script_dir}/../../ui/package.json" \
|
||||||
< "${script_dir}/../../ui/package.json" \
|
| sed -E 's/.*"version":[^0-9]*((0|[1-9][0-9]*)[0-9\.]*[0-9]).*$/\1/'
|
||||||
)"
|
)"
|
||||||
|
|
||||||
install_version="$( \
|
install_version="$( \
|
||||||
|
|
Loading…
Reference in a new issue