From 712c8f99da9445b200c34da9d2ecbd3cf61f1d59 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Tue, 3 Dec 2024 01:46:44 +0300 Subject: [PATCH] scripts/deploy.sh: add test for links to stable builds in README --- scripts/deploy.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index de5844f58..3f34e5b65 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -90,6 +90,20 @@ docs_history() return "${ret}" } +# Check for links to release builds in README.md +docs_links() +{ + ver_git="$(git tag -l | sort | grep -e "^v" | grep -v "rc" | tail -1)" + md="README.md" + ver_md="$(grep -c "${ver_git}" "${md}")" + ret=0 + if [ "${ver_md}" -ne 0 ]; then + ret=1 + echo "Please, update mention & links in ${md} inside Builds section for release builds with version ${ver_git}." + fi; + return "${ret}" +} + # source/Makefile:ALL_LANGUAGES & Translations/*.json automagical routine build_langs() { @@ -191,7 +205,9 @@ if [ "docs" = "${cmd}" ]; then hist="${?}" build_langs langs="${?}" - if [ "${readme}" -eq 0 ] && [ "${hist}" -eq 0 ] && [ "${langs}" -eq 0 ]; then + docs_links + links="${?}" + if [ "${readme}" -eq 0 ] && [ "${hist}" -eq 0 ] && [ "${langs}" -eq 0 ] && [ "${links}" -eq 0 ]; then ret=0 else ret=1 @@ -218,6 +234,11 @@ if [ "build_langs" = "${cmd}" ]; then exit "${?}" fi; +if [ "docs_links" = "${cmd}" ]; then + docs_links + exit "${?}" +fi; + if [ "check_style_file" = "${cmd}" ]; then check_style_file "${2}" exit "${?}"