Skip to content

Commit 1965c8a

Browse files
committed
Rewrite build_win.ps1 in Bash
1 parent a98f650 commit 1965c8a

File tree

3 files changed

+38
-28
lines changed

3 files changed

+38
-28
lines changed

.circleci/build_win.ps1

Lines changed: 0 additions & 26 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,7 @@ jobs:
16401640
- .\deps
16411641
- run:
16421642
name: "Building solidity"
1643-
command: .circleci/build_win.ps1
1644-
shell: powershell.exe
1643+
command: scripts/ci/build_win.sh
16451644
- run:
16461645
name: "Run solc.exe to make sure build was successful."
16471646
command: .\build\solc\Release\solc.exe --version

scripts/ci/build_win.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
(( $# <= 1 )) || { >&2 echo "Usage: $0 [PRERELEASE_SOURCE]"; exit 1; }
5+
prerelease_source="${1:-ci}"
6+
ROOTDIR="$(dirname "$0")/../.."
7+
FORCE_RELEASE="${FORCE_RELEASE:-}"
8+
CIRCLE_TAG="${CIRCLE_TAG:-}"
9+
10+
cd "$ROOTDIR"
11+
if [[ $FORCE_RELEASE != "" || $CIRCLE_TAG != "" ]]; then
12+
echo -n > prerelease.txt
13+
else
14+
# Use last commit date rather than build date to avoid ending up with builds for
15+
# different platforms having different version strings (and therefore producing different bytecode)
16+
# if the CI is triggered just before midnight.
17+
TZ=UTC git show --quiet --date="format-local:%Y.%-m.%-d" --format="${prerelease_source}.%cd"
18+
fi
19+
20+
mkdir build/
21+
cd build/
22+
23+
"${ROOTDIR}/deps/cmake/bin/cmake" \
24+
-G "Visual Studio 16 2019" \
25+
-DBoost_DIR="${ROOTDIR}/deps/boost/lib/cmake/Boost-"* \
26+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
27+
-DCMAKE_INSTALL_PREFIX="${ROOTDIR}/uploads/" \
28+
..
29+
msbuild solidity.sln \
30+
"/p:Configuration=Release" \
31+
"/m:10" \
32+
"/v:minimal"
33+
"${ROOTDIR}/deps/cmake/bin/cmake" \
34+
--build . \
35+
-j 10 \
36+
--target install \
37+
--config Release

0 commit comments

Comments
 (0)