-
Notifications
You must be signed in to change notification settings - Fork 13
/
appveyor.yml
137 lines (123 loc) · 5.03 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
# scripts that are called at very beginning, before repo cloning
init:
- date /T & time /T
- git config --global core.autocrlf input
- cmake --version
# 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))"
}
clone_depth: 5
version: '{build}'
platform:
- x86
# - x64
configuration:
- Release
#- Debug
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
CMAKE_GENERATOR: Visual Studio 17 2022
COMPILER: VC17
CMAKE_ARCHITECTURE: Win32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_GENERATOR: Visual Studio 16 2019
COMPILER: VC16
CMAKE_ARCHITECTURE: Win32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: Visual Studio 15 2017
COMPILER: VC15
CMAKE_ARCHITECTURE: Win32
#- generator: "MinGW Makefiles"
# COMPILER="MinGW"
matrix:
fast_finish: true
#cache:
# - C:\projects\fifechan-dependencies\downloads
# - C:\projects\fifengine-dependencies\includes
install:
# get dependencies
- cmake dependencies -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCHITECTURE%" -B../fifechan-dependencies/build
- cmake --build ../fifechan-dependencies/build --target ALL_BUILD --config %configuration%
# show dependency folders
- dir ..\fifechan-dependencies
- dir ..\fifechan-dependencies\downloads
- dir ..\fifechan-dependencies\includes /s
#before_build:
# git sh.exe conflicts with MinGW makefiles
#- if "%CMAKE_GENERATOR%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files\Git\usr\bin;=%")
build_script:
- dir
# create folder for an out-of-source-tree build: "c:\projects\build"
- cd..
- mkdir build
- cd build
# generate build script - SHARED
- >
cmake ..\fifechan
-G "%CMAKE_GENERATOR%"
-A "%CMAKE_ARCHITECTURE%"
-DCMAKE_BUILD_TYPE=%configuration%
-DCMAKE_INSTALL_PREFIX="c:/fifechan/install-shared"
# build
- cmake --build . --target ALL_BUILD --config %configuration%
# install
- cmake --build . --target INSTALL --config %configuration%
# generate build script - STATIC
- >
cmake ..\fifechan
-G "%CMAKE_GENERATOR%"
-A "%CMAKE_ARCHITECTURE%"
-DCMAKE_BUILD_TYPE=%configuration%
-DCMAKE_INSTALL_PREFIX="c:/fifechan/install-static"
-DBUILD_FIFECHAN_SHARED=OFF
-DBUILD_FIFECHAN_OPENGL_SHARED=OFF
-DBUILD_FIFECHAN_SDL_SHARED=OFF
# build
- cmake --build . --target ALL_BUILD --config %configuration% -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
# install
- cmake --build . --target INSTALL --config %configuration%
after_build:
# package artifact folder (shared library)
- cd c:\fifechan\install-shared
- mkdir bin
- move c:\fifechan\install-shared\lib\*.dll c:\fifechan\install-shared\bin
- 7z a -tzip -mx9 "%APPVEYOR_BUILD_FOLDER%\fifechan-shared-%APPVEYOR_BUILD_VERSION%-%COMPILER%-%platform%.zip"
- appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\fifechan-shared-%APPVEYOR_BUILD_VERSION%-%COMPILER%-%platform%.zip"
# publish an additional unversionized artifact (for being able to directly link the latest build)
- copy "%APPVEYOR_BUILD_FOLDER%\fifechan-shared-%APPVEYOR_BUILD_VERSION%-%COMPILER%-%platform%.zip" "%APPVEYOR_BUILD_FOLDER%\fifechan-shared-%COMPILER%-%platform%.zip"
- appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\fifechan-shared-%COMPILER%-%platform%.zip"
# package artifact folder (static library)
- cd c:\fifechan\install-static
- 7z a -tzip -mx9 "%APPVEYOR_BUILD_FOLDER%\fifechan-static-%APPVEYOR_BUILD_VERSION%-%COMPILER%-%platform%.zip"
- appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\fifechan-static-%APPVEYOR_BUILD_VERSION%-%COMPILER%-%platform%.zip"
# publish an additional unversionized artifact (for being able to directly link the latest build)
- copy "%APPVEYOR_BUILD_FOLDER%\fifechan-static-%APPVEYOR_BUILD_VERSION%-%COMPILER%-%platform%.zip" "%APPVEYOR_BUILD_FOLDER%\fifechan-static-%COMPILER%-%platform%.zip"
- appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\fifechan-static-%COMPILER%-%platform%.zip"
artifacts:
- path: '\fifechan-static-*.zip'
name: Static-Library
- path: '\fifechan-shared-*.zip'
name: Shared-Library
# deploy to Github Releases on tag push
deploy:
provider: GitHub
release: 'Fifechan $(APPVEYOR_REPO_TAG_NAME)'
tag: $(APPVEYOR_REPO_TAG_NAME)
description: '[**Changelog**](https://github.com/fifengine/fifechan/blob/master/CHANGELOG.md)'
artifact: Static-Library, Shared-Library
draft: false
prerelease: false
force_update: true # overwrite files of existing release on GitHub
on:
branch: master # release from master branch only
appveyor_repo_tag: true # deploy on tag push only
auth_token: # encrypted token from GitHub
secure: PklA532IBf2s4paPOoYBviN4cz1Dew9+Bce0aO6VaINDMCxDLRiNGeg3Jchaw03C