forked from gemrb/gemrb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
149 lines (133 loc) · 4.71 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
version: build-{build}
branches:
only:
- master
- /v\d+\.\d+\.\d+/
image: Visual Studio 2019
configuration: Release
clone_depth: 1
skip_commits:
# appveyor only searches for these in the first line by default
message: /\[ci skip\]/
only_commits:
files:
- CMakeLists.txt
- gemrb/**/*
- cmake/**/*
- platforms/windows/**/*
- .appveyor.yml
matrix:
fast_finish: true
max_jobs: 3
environment:
SF_ACC:
secure: gnSOiLDvnkRuEcD9+silVao5mf7D/pX2mo6tkfVIMas=
VCPKG_TARGET_TRIPLET: "x64-windows"
VCPKG_BUILD_TYPE: "release"
APPVEYOR_SAVE_CACHE_ON_ERROR: true
install:
- ps: |-
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
nuget install secure-file -ExcludeVersion
choco -r install openssh
secure-file\tools\secure-file -decrypt testing\id_travissfbot.av.enc -secret $env:SF_ACC
# chmod 400 ...
$path = ".\testing\id_travissfbot.av"
icacls.exe $path /reset
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
icacls.exe $path /inheritance:r
}
pushd c:\tools\vcpkg
git pull -q origin 2022.07.25
c:\tools\vcpkg\bootstrap-vcpkg.bat
popd
# (lib)vlc is missing from the vcpkg package list, so we don't build the plugin
cache:
- c:\tools\vcpkg\installed\
- c:\tools\vcpkg\packages\
- C:\ProgramData\chocolatey\lib
- C:\ProgramData\chocolatey\bin
- '%LocalAppData%\NuGet\v3-cache'
- '%LocalAppData%\vcpkg'
before_build:
- ps: |-
pushd c:\projects\gemrb
$git_version = (git rev-parse --short HEAD) | Out-String
$env:archive_file = -join("gemrb-win32-", $(Get-Date -Format "yyyy-MM-dd-"), $git_version.Trim(), ".zip")
$env:archive_path = -join("c:\projects\gemrb\", $env:archive_file)
$env:archive_source = -join("c:\gemrb-win32-", $git_version.Trim())
mkdir $env:archive_source
pushd $env:archive_source
mkdir Cache2
popd
popd
# improve the default config
$file = 'gemrb/GemRB.cfg.sample.in'
$find = '#PluginsPath=@DEFAULT_PLUGINS_DIR@'
$replace = "PluginsPath=.\plugins"
(Get-Content $file) -replace $find, $replace | Set-Content $file
$find = '#GemRBPath=\.'
$replace = "GemRBPath=."
(Get-Content $file) -replace $find, $replace | Set-Content $file
# add timer to work around appveyor cache problems, see build_script
$env:duration1 = Get-Date
$env:gl = "None"
if ($env:APPVEYOR_REPO_TAG_NAME -Or $env:APPVEYOR_REPO_COMMIT_MESSAGE -like '*buildgl*') {
$env:gl = "OpenGL"
}
cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENGL_BACKEND="$env:gl" -DINSOURCEBUILD=1 -DCMAKE_INSTALL_PREFIX="$env:archive_source" -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET="x64-windows" -A x64 -DPYTHON_VERSION="3.10...<3.11" -DUSE_TESTS=ON .
# set version to tag or version + commits since tag + commit hash
$git_version = (git describe --always) | Out-String
$git_version = $git_version -replace "`t|`n|`r|^v",""
$file = 'gemrb/core/InterfaceConfig.h'
$find = 'define VERSION_GEMRB .*$'
$replace = "define VERSION_GEMRB `"$git_version`""
(Get-Content $file) -replace $find, $replace | Set-Content $file
build_script:
- ps: |-
# break if things took too much time, so we can at least save the new cache
# it doesn't happen if the build gets killed after an hour
$duration2 = Get-Date
$span = New-TimeSpan -Start $env:duration1 -End $duration2
if ($span.TotalMinutes -ge 30) {
exit 1
}
pushd c:\projects\gemrb
cmake --build . -j 2 --config Release
after_build:
- ps: |-
pushd c:\projects\gemrb
if ($env:APPVEYOR_REPO_TAG_NAME) {
echo "Fetching heavy demo data!"
cmake --build . --target fetch-demo-data
}
cmake --build . --target install --config Release
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
popd
7z a -tzip $env:archive_path $env:archive_source
}
test_script:
- ps: |-
pushd c:\projects\gemrb
ctest -C Release --output-on-failure
if ($? -ne $true) {
throw "Test suite failed!"
}
popd
cd $env:archive_source
cp GemRB.cfg.sample GemRB.cfg.bots
Add-Content -Path GemRB.cfg.bots -Encoding ascii -Value "GamePath=minimal"
Add-Content -Path GemRB.cfg.bots -Encoding ascii -Value "GameType=test"
./gemrb.exe -q -c GemRB.cfg.bots
# ignore gl failures, since the build bot typically doesn't support it
if ($? -ne $true -and $env:gl -ne "OpenGL") {
throw "Failed test run!"
}
rm GemRB.cfg.bots
artifacts:
- path: gemrb*.zip
name: normal
deploy_script:
- cmd: |-
cd c:\projects\gemrb
scp -v -oStrictHostKeyChecking=no -i testing\id_travissfbot.av gemrb*.zip gemrb-travisbot@frs.sourceforge.net:/home/frs/project/gemrb/botbins/Windows/AppVeyor/