forked from LedgerHQ/lib-ledger-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
165 lines (140 loc) · 6.47 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
version: 1.0.{build}
image:
- Visual Studio 2015
environment:
LIB_VERSION: 2.6.0 # Hardcode the LIB_VERSION : should be retrieved by building libcore node module and run tests/lib_version.js
nodejs_version: "9"
appveyor_rdp_password:
secure: jb1LsDmcxCww7tA38S3xSw==
pub_key:
secure: B+4FNFeW6sbRsl7XJYnHUYptAx/2AvV7XySuhhEMdvcloUz0YXxgX/EguKV2Bvm5GaBKYLlq4G2Lw7udm4l68I9g3x+2pZvWiMBUhTRaTGVqi8PXXN+RON62G77yR9Lt/zUR+ljVjuJmRqQBU3NkzOJAAfZ/RDOCAEcWkA3cEE64IkfpqOTHBPW0PpwZcPGFF/l4MGdP8r5XIeu/WwPZHfQjGnDlME0VgkRWflA/Pjt0GcyDSLURXQBk+5JJhn9FjGPCKD+db4xQkW7zhep/su5urEf0HYTmVHRiKMZNfBPGSnL/Lmr6343qc6YF78lyX2U9saoJrf+tuxqAHtUq0KhkHltbNeIUaxvcC7TcH+kEm/Uxl/al8iRiMWE86b8z/wiFQI1xA+oejrFQivbyZVJ+cOifoZ7HhYwP+niOnUG+ZzT5WFLejnsnd4Lwdi5XzWaKKooIPtZ9qcyk15SFzVBayEeeljNk/gByrT6U+25LUqO6ekXrZ+A86Tmjkhp67B5+JNxis+k3sCZ63ASP6LhL9NvrVNky1ZGB8WAZ/hs=
matrix:
- TOOL_CONFIG: vs2015
BUILD_CONFIG: Debug
CMAKE_GENERATOR: "Visual Studio 14 2015 Win64"
QT5: C:\Qt\5.10.1\msvc2015_64
SQLITE3_DIR: C:\Tools\vcpkg\packages\sqlite3_x64-windows
CMAKE_DIR: C:\projects\deps\cmake
- TOOL_CONFIG: vs2015
BUILD_CONFIG: Release
CMAKE_GENERATOR: "Visual Studio 14 2015 Win64"
QT5: C:\Qt\5.10.1\msvc2015_64
SQLITE3_DIR: C:\Tools\vcpkg\packages\sqlite3_x64-windows
CMAKE_DIR: C:\projects\deps\cmake
- TOOL_CONFIG: mingw32
BUILD_CONFIG: Debug
CMAKE_GENERATOR: "MinGW Makefiles"
QT5: C:\Qt\5.10.1\mingw53_32
MINGW: C:\Qt\Tools\mingw530_32
SQLITE3_DIR: C:\Tools\vcpkg\packages\sqlite3_x64-windows
CMAKE_DIR: C:\projects\deps\cmake
- TOOL_CONFIG: mingw32
BUILD_CONFIG: Release
CMAKE_GENERATOR: "MinGW Makefiles"
QT5: C:\Qt\5.10.1\mingw53_32
MINGW: C:\Qt\Tools\mingw530_32
SQLITE3_DIR: C:\Tools\vcpkg\packages\sqlite3_x64-windows
CMAKE_DIR: C:\projects\deps\cmake
build:
verbosity: minimal
install:
#Install Sqlite3
- if not exist "%SQLITE3_DIR%" ( cinst -y sqlite --params '"/InstallDir:%SQLITE3_DIR%"' )
#Install cmake
- mkdir C:\projects\deps
- cd C:\projects\deps
- if not exist "%CMAKE_DIR%" (
set CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4-win64-x64.zip"
appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
7z x cmake.zip -oC:\projects\deps > nul
move C:\projects\deps\cmake-* C:\projects\deps\cmake
cmake --version
)
#Set SDK
- call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
#Add mingw, Qt5, sqlite3, cmake to PATH
- if %TOOL_CONFIG% == mingw32 set PATH=%MINGW%\bin;%PATH%
- set PATH=%QT5%\bin;%PATH%
- set PATH=C:\Tools\vcpkg\packages\sqlite3_x64-windows\bin;%PATH%
- set PATH=C:\projects\deps\cmake\bin;%PATH%
- set QTDIR=%QT5%
#Create public key
- ps: $fileContent = "-----BEGIN RSA PRIVATE KEY-----`n"
- ps: $fileContent += $env:priv_key.Replace(' ', "`n")
- ps: $fileContent += "`n-----END RSA PRIVATE KEY-----`n"
- ps: Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent
- ssh-keygen -y -f c:\users\appveyor\.ssh\id_rsa > c:\users\appveyor\.ssh\id_rsa.pub
#Install Node
- ps: Install-Product node $env:nodejs_version
#Init submodules
- cd C:\projects\lib-ledger-core
- git submodule update --init --recursive
#Checkout leveldb bitcoin-fork branch
- cd core\lib\leveldb
- git checkout bitcoin-fork || echo 'Checkout of bitcoin-fork branch on leveldb submodule failed'
#Remove sh from path otherwise mingw fail to launch
- ps: if ($env:TOOL_CONFIG -match 'mingw32') { Get-Command sh.exe -All | Remove-Item }
build_script:
#Create build directory
- cd C:/projects/
- mkdir lib-ledger-core-build
- cd lib-ledger-core-build
# Configuration
- if %BUILD_CONFIG% == Release (
cmake -G "%CMAKE_GENERATOR%" -DBUILD_TESTS=OFF ../lib-ledger-core
) else (
cmake -G "%CMAKE_GENERATOR%" -DCMAKE_PREFIX_PATH="%QT5%" -DCMAKE_INSTALL_PREFIX="%QT5%" ../lib-ledger-core
)
#Build
- if %TOOL_CONFIG% == mingw32 (
cmake --build . --config %BUILD_CONFIG% -- -j4
) else (
cmake --build . --config %BUILD_CONFIG% -- /m:4
)
- set DLL_NAME=libledger-core.dll
#Visual naming it ledger-core instead of libledger-core
- if %TOOL_CONFIG% == vs2015 set DLL_NAME=ledger-core.dll
#Copy dll in a lib-ledger-core's child directory:
#Only build directory child is supported for artifacts deployment
- set LIB_DIR=core\src\build
- if %TOOL_CONFIG% == vs2015 set LIB_DIR=%LIB_DIR%\%BUILD_CONFIG%
- set DLL_PATH=%LIB_DIR%\%DLL_NAME%
- cd ..\lib-ledger-core
- mkdir %LIB_VERSION%\win\%TOOL_CONFIG%
- if %BUILD_CONFIG% == Release cp "..\lib-ledger-core-build\%DLL_PATH%" ".\%LIB_VERSION%\win\%TOOL_CONFIG%" || echo "FAIL TO COPY DLL"
#Copy .lib generated by VS (needed for node module)
- set LIBRARY_OBJ_PATH=core\src\%BUILD_CONFIG%\ledger-core.lib
- if %TOOL_CONFIG% == vs2015 if %BUILD_CONFIG% == Release cp "..\lib-ledger-core-build\%LIBRARY_OBJ_PATH%" ".\%LIB_VERSION%\win\%TOOL_CONFIG%" || echo "FAIL TO COPY .LIB"
#Copy crypto.dll (also needed for node module)
- set CRYPTO_DLL_PATH=core\lib\openssl\crypto\build\%BUILD_CONFIG%\crypto.dll
- if %TOOL_CONFIG% == vs2015 if %BUILD_CONFIG% == Release cp "..\lib-ledger-core-build\%CRYPTO_DLL_PATH%" ".\%LIB_VERSION%\win\%TOOL_CONFIG%" || echo "FAIL TO COPY CRYPTO DLL"
#Launch tests
- if %BUILD_CONFIG% == Debug ctest --output-on-failure -VV
#Build is failing because of configuration
##Create node module
#- cd C:/projects/lib-ledger-core/ledger-core-samples/nodejs
#- npm install -g node-gyp
#- npm install
#- node-gyp --release configure --msvs_version=2015
#- node-gyp --release build
##- npm install
#- set LIB_VERSION=$(node sample/lib-version.js)
#- echo " >> Get Libcore version %LIB_VERSION%"
- set COMMIT_HASH=%APPVEYOR_REPO_COMMIT:~0,6%
- if %APPVEYOR_REPO_TAG%==true (
set "DEPLOY_VERSION=%LIB_VERSION%"
) else (
set "DEPLOY_VERSION=%LIB_VERSION%-rc-%COMMIT_HASH%"
)
after_build:
- set should_deploy=false
- if %APPVEYOR_REPO_BRANCH%==develop set should_deploy=true
- if %APPVEYOR_REPO_BRANCH%==master set should_deploy=true
- if %APPVEYOR_REPO_TAG%==true set should_deploy=true #for tests
- if %should_deploy%==true aws s3 sync ".\%LIB_VERSION%\win\%TOOL_CONFIG%" "s3://ledger-lib-ledger-core/%DEPLOY_VERSION%/win/%TOOL_CONFIG%" --acl public-read
artifacts:
- path: .\%LIB_VERSION%\win\%TOOL_CONFIG%\*
name: core_library
#on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))