File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -1001,6 +1001,7 @@ jobs:
10011001 << : *base_ubuntu2404_xlarge
10021002 steps :
10031003 - build
1004+ - run : cat prerelease.txt
10041005
10051006 # x64 ASAN build, for testing for memory related bugs
10061007 b_ubu_asan : &b_ubu_asan
Original file line number Diff line number Diff line change @@ -8,14 +8,22 @@ source "${REPO_ROOT}/scripts/common.sh"
88cd " $REPO_ROOT "
99version=$( scripts/get_version.sh)
1010commit_hash=$( git rev-parse --short=8 HEAD)
11- commit_date=$( TZ=UTC git show --quiet --date=" format-local:%Y.%-m.%-d" --format=" %cd" )
1211
13- # File exists and has zero size -> not a prerelease
14- if [[ -e prerelease.txt && ! -s prerelease.txt ]]; then
15- version_string=" $version "
16- elif [[ -e prerelease.txt ]]; then
17- version_string=" ${version} -$( cat prerelease.txt) -${commit_hash} "
12+ if [[ -e prerelease.txt ]]; then
13+ prerelease_suffix=$( cat prerelease.txt)
14+ if [[ $prerelease_suffix == " " ]]; then
15+ # File exists and has zero size -> not a prerelease
16+ version_string=" $version "
17+ elif [[ $prerelease_suffix == pre.* ]]; then
18+ # Tagged prerelease -> unambiguous, so commit hash not needed
19+ version_string=" ${version} -${prerelease_suffix} "
20+ else
21+ # Nightly/develop/other prerelease -> include commit hash
22+ version_string=" ${version} -${prerelease_suffix} -${commit_hash} "
23+ fi
1824else
25+ # Nightly/develop/other prerelease -> include commit hash + default prerelease suffix
26+ commit_date=$( TZ=UTC git show --quiet --date=" format-local:%Y.%-m.%-d" --format=" %cd" )
1927 version_string=" ${version} -nightly-${commit_date} -${commit_hash} "
2028fi
2129
Original file line number Diff line number Diff line change @@ -11,8 +11,10 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
1111 GNU_DATE=gdate
1212fi
1313
14- if [[ $FORCE_RELEASE != " " || $git_tag == v * ]]; then
14+ if [[ $FORCE_RELEASE != " " || $git_tag =~ ^v[0-9.]+$ ]]; then
1515 echo -n
16+ elif [[ $git_tag =~ ^v[0-9.]+-pre. ]]; then
17+ echo -n " pre.${git_tag#* -pre.} "
1618else
1719 # Use last commit date rather than build date to avoid ending up with builds for
1820 # different platforms having different version strings (and therefore producing different bytecode)
You can’t perform that action at this time.
0 commit comments