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/