CircleCI Windows config and install_deps.ps1 script.

This commit is contained in:
Daniel Kirchner 2020-09-15 14:47:30 +02:00
parent 860226e25d
commit d66b6f1c46
3 changed files with 59 additions and 0 deletions

7
.circleci/build_win.ps1 Normal file
View File

@ -0,0 +1,7 @@
cd "$PSScriptRoot\.."
mkdir build
cd build
$boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*)
..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" ..
msbuild solidity.sln /p:Configuration=Release /m:5 /v:minimal
..\deps\cmake\bin\cmake --build . -j 5 --target install --config Release

View File

@ -27,6 +27,9 @@ parameters:
type: string
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:23dad3b34deae8107c8551804ef299f6a89c23ed506e8118fac151e2bdc9018c"
orbs:
win: circleci/windows@2.2.0
defaults:
# --------------------------------------------------------------------------
@ -64,6 +67,11 @@ defaults:
path: build/solc/solc
destination: solc
# windows binary archive
- artifact_solc_windows: &artifact_solc_windows
path: upload/solidity-windows.zip
destination: solidity-windows.zip
# compiled tool executable target
- artifacts_tools: &artifacts_tools
path: build/tools/solidity-upgrade
@ -876,6 +884,32 @@ jobs:
- run: *gitter_notify_failure
- run: *gitter_notify_success
b_win:
executor:
name: win/default
shell: powershell.exe
steps:
- checkout
- restore_cache:
keys:
- dependencies-win-{{ checksum "scripts/install_deps.ps1" }}
- run:
name: "Installing dependencies"
command: if ( -not (Test-Path .\deps\boost) ) { .\scripts\install_deps.ps1 }
- save_cache:
key: dependencies-win-{{ checksum "scripts/install_deps.ps1" }}
paths:
- .\deps\boost
- .\deps\cmake
- run:
name: "Building solidity"
command: .circleci/build_win.ps1
- run:
name: "Package solidity"
command: Compress-Archive -Path .\upload\bin\* -DestinationPath .\upload\solidity-windows.zip
- store_artifacts: *artifact_solc_windows
- persist_to_workspace: *artifacts_build_dir
workflows:
version: 2
@ -927,6 +961,9 @@ workflows:
- t_ems_compile_ext_gnosis: *workflow_emscripten
- t_ems_compile_ext_zeppelin: *workflow_emscripten
# Windows build and tests
- b_win: *workflow_trigger_on_tags
nightly:
triggers:

15
scripts/install_deps.ps1 Normal file
View File

@ -0,0 +1,15 @@
# Needed for Invoke-WebRequest to work via CI.
$progressPreference = "silentlyContinue"
New-Item -ItemType Directory -Force -Path "$PSScriptRoot\..\deps"
Invoke-WebRequest -URI "https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-win64-x64.zip" -OutFile cmake.zip
tar -xf cmake.zip
mv cmake-3.18.2-win64-x64 "$PSScriptRoot\..\deps\cmake"
Invoke-WebRequest -URI "https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.zip" -OutFile boost.zip
tar -xf boost.zip
cd boost_1_74_0
.\bootstrap.bat
.\b2 -j4 -d0 link=static runtime-link=static variant=release threading=multi address-model=64 --with-filesystem --with-system --with-program_options --with-test --prefix="$PSScriptRoot\..\deps\boost" install
cd ..