Skip to content

Commit f1e9abb

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

File tree

3 files changed

+36
-28
lines changed

3 files changed

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

0 commit comments

Comments
 (0)