-
Notifications
You must be signed in to change notification settings - Fork 7
/
appveyor.yml
132 lines (115 loc) · 3.77 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
# shallow clone
clone_depth: 10
os: Visual Studio 2017
platform:
- x64
- x86
environment:
matrix:
- Toolset: "2015"
- Toolset: "2017"
- Toolset: mingw
cache:
- x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z
- i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
branches:
except:
- gh-pages
install:
- git submodule update --init --recursive
- ps: |
if ($env:PLATFORM -eq "x64") {
$env:MINGW_DIR = "mingw64"
$env:MINGW_URL = "https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.2/threads-win32/seh/x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z/download"
$env:MINGW_ARCHIVE = "x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z"
} else {
$env:MINGW_DIR = "mingw32"
$env:MINGW_URL = "https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/dwarf/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z/download"
$env:MINGW_ARCHIVE = "i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z"
}
- ps: |
if ($env:TOOLSET -eq "mingw") {
cmd /C 'if not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%"'
cmd /C '7z x -y "%MINGW_ARCHIVE%" > nul'
python -m ensurepip
python -m pip install cpp-coveralls==0.3.11
}
- ps: Get-Command sh.exe -All | Remove-Item
before_build:
- ps: |
md build
cd build
$generator = switch ($env:TOOLSET) {
"2015" {"Visual Studio 14 2015"}
"2017" {"Visual Studio 15 2017"}
"mingw" {"MinGW Makefiles"}
}
if (($env:PLATFORM -eq "x64") -and ($env:TOOLSET -ne "mingw")) {
$generator = "$generator Win64"
}
if ($env:TOOLSET -eq "mingw") {
$env:PATH = "$pwd.Path\..\$env:MINGW_DIR\bin;$env:PATH"
cmake -G "$generator" .. -DTESTING=1 -DSAMPLES=0 -DCMAKE_BUILD_TYPE=Debug
} else {
cmake -G "$generator" .. -DTESTING=1 -DCMAKE_CONFIGURATION_TYPES="Debug;Release"
}
cd ..
build:
verbosity: minimal
build_script: |
cd build
if "%TOOLSET%"=="mingw" cmake --build . -- -j4
if "%APPVEYOR_REPO_TAG%"=="true" if NOT "%TOOLSET%"=="mingw" cmake --build . --config Release
if NOT "%TOOLSET%"=="mingw" cmake --build . --config Debug
test_script:
- ps: |
if ($env:TOOLSET -eq "mingw") {
$env:CTEST_OUTPUT_ON_FAILURE = 1
ctest
} else {
.\tests\Debug\test_all.exe
}
after_build:
- ps: |
if ($env:TOOLSET -eq "mingw") {
mkdir lib
if ($env:appveyor_repo_tag -eq "true") {
mkdir release
cd release
cmake -G "$generator" ../.. -DTESTING=0 -DCMAKE_BUILD_TYPE=Release
cmd /C 'cmake --build . -- -j4'
cp libcuhkszlib.a ..\lib
cd ..
} else {
cp libcuhkszlib.a ..\lib
}
7z a -tzip windows-$env:PLATFORM-mingw.zip ..\build\lib ..\src\include
} else {
mkdir lib
if ($env:appveyor_repo_tag -eq "true") {
cp -r ..\build\Debug lib
cp -r ..\build\Release lib
if ($env:Toolset -eq "2017") {
7z a -tzip windows-$env:PLATFORM-samples.zip ..\build\samples\Release\*
}
} else {
cp -r ..\build\Debug lib
}
7z a -tzip windows-$env:PLATFORM-msvc-$env:TOOLSET.zip lib ..\src\include ..\ide-project-files\vs-$env:PLATFORM\* ..\ide-project-files\src
}
artifacts:
- path: build\*.zip
name: cuhkszlib
type: zip
deploy:
provider: GitHub
description: |
CUHKSZ C++ library release. TODO add more details.
auth_token:
secure: "IzRhaJiev+xncjB2O11GXuONvPyqAhmZaT5uZtVHi5u5L4C2LKtmV+Xoe7IRiOIg"
artifact: cuhkszlib
draft: true
prerelease: true
force_update: true
on:
appveyor_repo_tag: true