forked from gemrb/gemrb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
120 lines (109 loc) · 3.7 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
version: build-{build}
branches:
only:
- master
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: "x86-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-", $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
cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DINSOURCEBUILD=1 -DWIN32_USE_STDIO=1 -DCMAKE_INSTALL_PREFIX="$env:archive_source" -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET="x86-windows" -A Win32 .
# 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/includes/globals.h'
$find = 'define VERSION_GEMRB .*$'
$replace = "define VERSION_GEMRB `"$git_version`""
(Get-Content $file) -replace $find, $replace | Set-Content $file
build_script:
- ps: |-
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:
- cmd: |-
cd C:/gemrb-win32*
cp GemRB.cfg.sample GmRB.cfg.bots
echo GamePath=minimal >> GemRB.cfg.bots
echo GameType=test >> GemRB.cfg.bots
gemrb.exe -q -c GemRB.cfg.bots
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 [email protected]:/home/frs/project/gemrb/botbins/Windows/AppVeyor/