diff --git a/scripts/version_name.sh b/scripts/version_name.sh index 499dc67299..59b533ba9b 100755 --- a/scripts/version_name.sh +++ b/scripts/version_name.sh @@ -1,12 +1,11 @@ #!/bin/bash function release_version() { - local build_file="${GITHUB_WORKSPACE}/build.gradle" - local version_name_key="ext.version_name" + local build_file="${GITHUB_WORKSPACE}/dependencies.gradle" + local version_name_key="version_name" local version_name_regex="^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-(alpha|beta|rc)[0-9]{2}){0,1}$" - local version - version=$(grep "${version_name_key}" "${build_file}" | sed -E "s/.*${version_name_key}[[:space:]]*=[[:space:]]*[\"\'](.*)[\"\'].*/\1/") + local version=$(sed -n "s/.*${version_name_key}[[:space:]]*=[[:space:]]*[\"\']\(.*\)[\"\'].*/\1/p" ${build_file}) if [[ ! ${version} =~ ${version_name_regex} ]]; then echo "Error: invalid version name [$version], please validate that [$version_name_key] at [$build_file] follows regex $version_name_regex ." @@ -16,4 +15,4 @@ function release_version() { echo "$version" } -release_version \ No newline at end of file +release_version