forked from mario128mex/lib-ledger-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
174 lines (150 loc) · 8.49 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
166
167
168
169
170
171
172
173
174
version: 1.0.{build}
branches:
only:
- develop
image:
- Visual Studio 2015
environment:
LIB_VERSION: 1.1.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==
priv_key:
secure: jI9y+0Gesg/xCoBv/ffAvnvQ/G9R4s9LY+oAk2ZzI/pjK8gWFFYbX3PjyYBjCTl891yv/l0jS62jh2LZifMgwSeMM+q0Fqjm5RIAEoZGxhPLf0vVWU0nI7v5zGaX7BNeXySaZjKb0LL3LJ4jC/NaeLD+i0p+3JmTMm16V3DQG/m8HLfrpzr4oGgx6xtj3pd7NWgsSzHKhY5SgCtepjJ4B9DeTOjJPV/UEOrYR+NLPBPt+f4yE5InIK3CbLA8d7SeQmntYpMtNC1/EiuewtXzAkkYjea4DlRLa66cogN1u2p7dxuh2zfR9q+4YP+XkH6pERbKdRm+sp9DcK6WTkikpbvVQO0aK8F2FKRW66WQlIyljGf/glydr6Riht8yrBi9CwrmI1kuouwrfvT1c9B6xN+3oLQiQ3bwG/LqQAT6eX7BusRN7gjx1uoxZ2jDHlb0g7NX8l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WaKKooIPtZ9qcyk15SFzVBayEeeljNk/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://cmake.org/files/v3.9/cmake-3.9.0-rc6-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: 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%"
artifacts:
- path: .\%LIB_VERSION%\win\%TOOL_CONFIG%\*
name: core_library
deploy:
- provider: S3
on:
branch: develop
access_key_id: AKIAJSAWFEBNBALPW4LQ
secret_access_key:
secure: ULBO2dVcftolkrtW0MAvJ4EWcWMCFdmkmsHxfuAjG9/a6U/JrKkzD/f2CUukj4hV
bucket: ledger-lib-ledger-core
region: eu-west-1
set_public: true
artifact: core_library
#on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
notifications:
- provider: Slack
incoming_webhook: https://hooks.slack.com/services/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
on_build_success: true
on_build_failure: true
on_build_status_changed: false