Skip to content

Commit 39bed74

Browse files
committed
CI: Use the same logic for prerelease suffix as during build
1 parent 927bb1c commit 39bed74

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.circleci/config.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,13 @@ commands:
187187
- run:
188188
name: Store prerelease suffix
189189
command: |
190-
if [[ -n $CIRCLE_TAG ]]; then
191-
echo -n > prerelease.txt;
190+
if [[ -n "$CIRCLE_TAG" || -n "$FORCE_RELEASE" ]]; then
191+
echo -n > prerelease.txt
192192
else
193-
date -u +"nightly.%Y.%-m.%-d" > prerelease.txt;
193+
# Use last commit date rather than build date to avoid ending up with builds for
194+
# different platforms having different version strings (and therefore producing different bytecode)
195+
# if the CI is triggered just before midnight.
196+
TZ=UTC git show --quiet --date="format-local:%Y.%-m.%-d" --format="nightly.%cd" > prerelease.txt
194197
fi
195198
196199
install_and_check_minimum_requirements:

0 commit comments

Comments
 (0)