-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
128 lines (113 loc) · 5.65 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
# version format
version: v{build}
branches:
only:
- master
- deployment
# Skipping commits with particular message or from specific user
skip_commits:
message: "*[skip ci]*"
image: Visual Studio 2022
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
environment:
NuGetPackageSourceCredentials_github: # value: Username=dlebansais;Password={github package token}
secure: Fd8cbeFRzxym3D4FpbJo2m943iBsBRgrAGOEFhMHDO90WMUkfdJECxPcHpWmkxregb17bhgiIhvFJB9ac4dx3cr3ZpsxpqTzIc61BaUiv90=
opencover_version: 4.7.1221
codecov_uploader_version: 0.7.1
report_generator_version: 5.2.0
PACKAGE_PREFIX: dlebansais
matrix:
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
before_build:
- nuget restore %APPVEYOR_PROJECT_NAME%.sln
- nuget install GitCommitId -DependencyVersion Highest -OutputDirectory packages
configuration:
- Release
- Debug
build:
project: $(APPVEYOR_PROJECT_NAME).sln
after_build:
- nuget install Packager -DependencyVersion Highest -OutputDirectory packages # Install Packager
- ps: $folder = Get-ChildItem -Path packages/Packager.* -Name | Out-String # Get the installation folder (we don't know the actual version)
- ps: $firstline = ($folder -split '\r\n')[0] # Get rid of carriage-return
- ps: $fullpath = ".\packages\$firstline\lib\net481\Packager.exe" # Build full path
- ps: $env:PACKAGER_PATH=$fullpath
- '%PACKAGER_PATH% %CUSTOM_PACKAGER_OPTIONS% --prefix=%PACKAGE_PREFIX%' # Execute the packager: the output is nuget\%APPVEYOR_PROJECT_NAME%.nuspec
- if exist nuget\%PACKAGE_PREFIX%.%APPVEYOR_PROJECT_NAME%.nuspec nuget pack nuget\%PACKAGE_PREFIX%.%APPVEYOR_PROJECT_NAME%.nuspec
- '%PACKAGER_PATH% %CUSTOM_PACKAGER_OPTIONS% --prefix=%PACKAGE_PREFIX% --debug' # Execute the packager: the output is nuget-debug\%APPVEYOR_PROJECT_NAME%-Debug.nuspec
- if exist nuget-debug\%PACKAGE_PREFIX%.%APPVEYOR_PROJECT_NAME%-Debug.nuspec nuget pack nuget-debug\%PACKAGE_PREFIX%.%APPVEYOR_PROJECT_NAME%-Debug.nuspec
- ps: $xml = [xml](Get-Content .\$env:APPVEYOR_PROJECT_NAME\$env:APPVEYOR_PROJECT_NAME.csproj)
- ps: $version=$xml.Project.PropertyGroup.Version
- ps: set version_tag v$version
- ps: $version_tag=$version_tag.Trim()
- ps: $env:VERSION_TAG=$version_tag
- echo Version is "%VERSION_TAG%"
before_test:
- nuget install OpenCover -Version %opencover_version% -OutputDirectory packages
- nuget install CodecovUploader -Version %codecov_uploader_version% -OutputDirectory packages
- nuget install ReportGenerator -Version %report_generator_version% -OutputDirectory packages
- |-
printf "dotnet test ./Test/%APPVEYOR_PROJECT_NAME%.Test/bin/x64/%CONFIGURATION%/net481/%APPVEYOR_PROJECT_NAME%.Test.dll -l console;verbosity=detailed\n" > run-tests.bat
printf "dotnet test ./Test/%APPVEYOR_PROJECT_NAME%.Test/bin/x64/%CONFIGURATION%/net8.0-windows7.0/%APPVEYOR_PROJECT_NAME%.Test.dll -l console;verbosity=detailed\n" >> run-tests.bat
- |-
printf "@echo ************************************************************** Starting Tests..\n" > run-tests1.bat
printf "call run-tests.bat\n" >> run-tests1.bat
- |-
printf ".\packages\OpenCover.%opencover_version%\Tools\OpenCover.Console.exe -register:user -returntargetcode -target:\x25\x31 -mergeoutput -output:""Coverage-%APPVEYOR_PROJECT_NAME%.xml""\n" > opencover.bat
- |-
printf ".\packages\CodecovUploader.%codecov_uploader_version%\Tools\Codecov.exe -f ""Coverage-%APPVEYOR_PROJECT_NAME%.xml""\n" > after-test.bat
printf ".\packages\ReportGenerator.%report_generator_version%\Tools\Net8.0\ReportGenerator.exe ""-reports:Coverage-%APPVEYOR_PROJECT_NAME%.xml"" -targetdir:.\CoverageReports ""-assemblyfilters:-Microsoft*;+%APPVEYOR_PROJECT_NAME%"" ""-filefilters:-*.g.cs"" -reporttypes:textsummary\n" >> after-test.bat
test_script:
- if '%APPVEYOR_REPO_BRANCH%' == 'master' opencover.bat run-tests1.bat
after_test:
- if '%APPVEYOR_REPO_BRANCH%' == 'master' after-test.bat
artifacts:
- path: $(PACKAGE_PREFIX).$(APPVEYOR_PROJECT_NAME)-Debug.*.nupkg
name: $(APPVEYOR_PROJECT_NAME)-Package-Debug
- path: $(PACKAGE_PREFIX).$(APPVEYOR_PROJECT_NAME).*.nupkg
name: $(APPVEYOR_PROJECT_NAME)-Package-Release
deploy:
- provider: GitHub
release: $(VERSION_TAG)
description: 'Automatic deployment'
auth_token:
secure: 8IyH+0A5FwE96xWDzhXQH5zxg49+0MhTd25bUTMcc6qePhZcVmaVd6i0bsM2tT1Q
artifact: $(APPVEYOR_PROJECT_NAME)-Package-Release
draft: false
prerelease: false
on:
branch: deployment
configuration: Release
- provider: GitHub
release: $(VERSION_TAG)
description: 'Automatic deployment'
auth_token:
secure: 8IyH+0A5FwE96xWDzhXQH5zxg49+0MhTd25bUTMcc6qePhZcVmaVd6i0bsM2tT1Q
artifact: $(APPVEYOR_PROJECT_NAME)-Package-Debug
draft: false
prerelease: false
on:
branch: deployment
configuration: Debug
- provider: NuGet
server: https://nuget.pkg.github.com/dlebansais/index.json
symbol_server: https://nuget.pkg.github.com/dlebansais/index.json
artifact: $(APPVEYOR_PROJECT_NAME)-Package-Debug
username: dlebansais
api_key:
secure: P1otXPxREK8T2L9vw4vpvvpXYlMyCTGa/iQIfuXtr4mjOFZBYR83Aie3hTZotfOu
on:
branch: deployment
configuration: Debug
- provider: NuGet
server: https://nuget.pkg.github.com/dlebansais/index.json
artifact: $(APPVEYOR_PROJECT_NAME)-Package-Release
skip_symbols: true
username: dlebansais
api_key:
secure: P1otXPxREK8T2L9vw4vpvvpXYlMyCTGa/iQIfuXtr4mjOFZBYR83Aie3hTZotfOu
on:
branch: deployment
configuration: Release