-
Notifications
You must be signed in to change notification settings - Fork 12
/
appveyor.yml
84 lines (71 loc) · 2.54 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
version: Build {Build}
image: Visual Studio 2022
matrix:
fast_finish: true
environment:
matrix:
- PlatformToolset: v143
platform:
- x64
- x86
configuration:
- Release
- Debug
install:
- if "%platform%"=="x64" set archi=amd64
- if "%platform%"=="x64" set platform_input=x64
- if "%platform%"=="x86" set archi=x86
- if "%platform%"=="x86" set platform_input=x86
- if "%PlatformToolset%"=="v143" call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" %archi%
before_build:
- ps: |
Write-Output "Configuration: $env:CONFIGURATION"
Write-Output "Platform: $env:PLATFORM_INPUT"
$generator = switch ($env:PLATFORMTOOLSET)
{
"v143" {"Visual Studio 17 2022"}
}
# cmake build type, depended on the used generator, see https://cmake.org/cmake/help/v3.6/variable/CMAKE_BUILD_TYPE.html#variable:CMAKE_BUILD_TYPE
# seems vs build always needs also the debug config, choose via the config option to the build command
$build_type = "-DCMAKE_CONFIGURATION_TYPES=""Debug;Release"" "
$build_config = "--config $env:CONFIGURATION"
Write-Output "build_type: $build_type"
Write-Output "build_config: $build_config"
build_script:
- ps: |
cd c:\projects\nppgtags\
md _build -Force | Out-Null
cd _build
if ($env:PLATFORM_INPUT -eq "x64")
{
& cmake -G "$generator" -A x64 $build_type ..
}
else
{
& cmake -G "$generator" -A Win32 $build_type ..
}
if ($LastExitCode -ne 0) {
throw "Exec: $ErrorMessage"
}
& cmake --build . --config $env:CONFIGURATION
if ($LastExitCode -ne 0) {
throw "Exec: $ErrorMessage"
}
after_build:
- ps: |
cd c:\projects\nppgtags\
$NppGTagsFileName = "NppGTags.$env:PLATFORM_INPUT.$env:CONFIGURATION.$env:PLATFORMTOOLSET.dll"
Push-AppveyorArtifact "_build\$env:CONFIGURATION\NppGTags.dll" -FileName "$NppGTagsFileName"
if ($($env:APPVEYOR_REPO_TAG) -eq "true" -and $env:CONFIGURATION -eq "Release")
{
$ZipFileName = "NppGTags_$($env:APPVEYOR_REPO_TAG_NAME)_$env:PLATFORM_INPUT.zip"
md deploy -Force | Out-Null
md deploy\NppGTags -Force | Out-Null
Copy-Item _build\$env:CONFIGURATION\NppGTags.dll deploy\NppGTags\NppGTags.dll
Copy-Item bin\* deploy\NppGTags\ -Recurse
7z a $ZipFileName .\deploy\NppGTags\*
Remove-Item deploy\NppGTags\* -Recurse
}
artifacts:
- path: NppGTags_*.zip
name: releases