-
Notifications
You must be signed in to change notification settings - Fork 6
/
appveyor.yml
91 lines (79 loc) · 3.05 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
# Build worker image (VM template)
image: Visual Studio 2015
# scripts that are called at very beginning, before repo cloning
init:
- date /T & time /T
- git config --global core.autocrlf input
- cmake --version
# go to hell Xamarin (see http://help.appveyor.com/discussions/problems/4569)
- del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
# Set "build version number" to "short-commit-hash" or when tagged to "tag name" (Travis style)
- ps: >-
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME"
}
else
{
Update-AppveyorBuild -Version "dev-$($env:APPVEYOR_REPO_COMMIT.substring(0,7))"
}
branches:
only:
- master
clone_depth: 5
version: '{build}'
platform:
- x86
configuration:
- Release
#- Debug
environment:
MSBUILD_FLAGS: /verbosity:minimal /maxcpucount
matrix:
- generator: "Visual Studio 14"
#- generator: "MinGW Makefiles"
matrix:
fast_finish: true
#cache:
# - c:\project\fifengine-cpp-tutorials\dependencies
install:
# install fifengine
- curl -LfsS -o libfife.zip https://ci.appveyor.com/api/buildjobs/7xflrp0frgit15u5/artifacts/libfife-dev-c4d5f09-VC14.zip
- 7z x libfife.zip -o%APPVEYOR_BUILD_FOLDER%\dependencies -y > nul
# install fifengine dependencies
- curl -LfsS -o libfife-deps.zip https://ci.appveyor.com/api/buildjobs/7xflrp0frgit15u5/artifacts/libfife-dependencies-dev-c4d5f09-VC14.zip
- 7z x libfife-deps.zip -o%APPVEYOR_BUILD_FOLDER%\dependencies -y > nul
build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- dir
# create folder for an out-of-source-tree build: "c:\projects\build"
- cd..
- mkdir build
- cd build
# generate build script
- >
cmake %APPVEYOR_BUILD_FOLDER%\src
-G "%generator%"
-DCMAKE_INSTALL_PREFIX=./tutorials
# build
- cmake --build . --target ALL_BUILD --config %configuration% -- /nologo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
# install
- cmake --build . --target INSTALL --config %configuration% -- /nologo
# package (with cpack)
#- cmake --build ./build --target PACKAGE --config %configuration% -- /nologo
after_build:
# set compiler var
- if "%generator%"=="Visual Studio 14" (set COMPILER="VC14")
- if "%generator%"=="MinGW Makefiles" (set COMPILER="MinGW")
# copy required system libraries from \bin folder into \Tutorials1 folder
- xcopy C:\projects\build\tutorials\bin\*.* C:\projects\build\tutorials\Tutorial1
- rd /s /q C:\projects\build\tutorials\bin
# switch to project build folder and zip "tutorials" folder
- cd C:\projects\build
- 7z a -tzip -mx9 "tutorials-%APPVEYOR_BUILD_VERSION%-%COMPILER%.zip" tutorials
# switch to project directory and zip append the "assets" folder
- cd %APPVEYOR_BUILD_FOLDER%
- 7z a -tzip -mx9 "C:\projects\build\tutorials-%APPVEYOR_BUILD_VERSION%-%COMPILER%.zip" assets
# finally, push the tutorials artifact
- cd C:\projects\build
- appveyor PushArtifact "tutorials-%APPVEYOR_BUILD_VERSION%-%COMPILER%.zip"