mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10772 from ethereum/fix-commit-date-in-ci-builds-on-mac-os
Fix commit date command for CI builds on macOS
This commit is contained in:
commit
cae1b75932
@ -6,6 +6,14 @@ if ("$Env:FORCE_RELEASE" -Or "$Env:CIRCLE_TAG") {
|
|||||||
New-Item prerelease.txt -type file
|
New-Item prerelease.txt -type file
|
||||||
Write-Host "Building release version."
|
Write-Host "Building release version."
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
# Use last commit date rather than build date to avoid ending up with builds for
|
||||||
|
# different platforms having different version strings (and therefore producing different bytecode)
|
||||||
|
# if the CI is triggered just before midnight.
|
||||||
|
$last_commit_timestamp = git log -1 --date=unix --format=%ad HEAD
|
||||||
|
$last_commit_date = (Get-Date -Date "1970-01-01 00:00:00Z").toUniversalTime().addSeconds($last_commit_timestamp).ToString("yyyy.M.d")
|
||||||
|
-join("ci.", $last_commit_date) | out-file -encoding ascii prerelease.txt
|
||||||
|
}
|
||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
@ -12,8 +12,7 @@ else
|
|||||||
# Use last commit date rather than build date to avoid ending up with builds for
|
# Use last commit date rather than build date to avoid ending up with builds for
|
||||||
# different platforms having different version strings (and therefore producing different bytecode)
|
# different platforms having different version strings (and therefore producing different bytecode)
|
||||||
# if the CI is triggered just before midnight.
|
# if the CI is triggered just before midnight.
|
||||||
last_commit_timestamp=$(git log -1 --date=iso --format=%ad HEAD)
|
TZ=UTC git show --quiet --date="format-local:%Y.%-m.%-d" --format="ci.%cd" >prerelease.txt
|
||||||
date -d "$last_commit_timestamp" -u "+ci.%Y.%-m.%-d" >prerelease.txt
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$CIRCLE_SHA1" ]
|
if [ -n "$CIRCLE_SHA1" ]
|
||||||
|
@ -47,11 +47,16 @@ cd $WORKSPACE
|
|||||||
# shellcheck disable=SC2166
|
# shellcheck disable=SC2166
|
||||||
if [[ "$CIRCLE_BRANCH" = release || -n "$CIRCLE_TAG" || -n "$FORCE_RELEASE" || "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]
|
if [[ "$CIRCLE_BRANCH" = release || -n "$CIRCLE_TAG" || -n "$FORCE_RELEASE" || "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]
|
||||||
then
|
then
|
||||||
echo -n >prerelease.txt
|
echo -n >prerelease.txt
|
||||||
|
else
|
||||||
|
# Use last commit date rather than build date to avoid ending up with builds for
|
||||||
|
# different platforms having different version strings (and therefore producing different bytecode)
|
||||||
|
# if the CI is triggered just before midnight.
|
||||||
|
TZ=UTC git show --quiet --date="format-local:%Y.%-m.%-d" --format="ci.%cd" >prerelease.txt
|
||||||
fi
|
fi
|
||||||
if [ -n "$CIRCLE_SHA1" ]
|
if [ -n "$CIRCLE_SHA1" ]
|
||||||
then
|
then
|
||||||
echo -n "$CIRCLE_SHA1" >commit_hash.txt
|
echo -n "$CIRCLE_SHA1" >commit_hash.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $BUILD_DIR
|
mkdir -p $BUILD_DIR
|
||||||
|
Loading…
Reference in New Issue
Block a user