-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
84 lines (72 loc) · 2.3 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
image: Visual Studio 2019
version: 'build.{build}'
branches:
only:
- master
environment:
OpenCoverToken:
secure: Pn8fcFeMu/oGCqsK70UiOauIHM1PShVqPxY3wB1jw0mT0G/QALa5NFlcN9XoGYww
configuration: release
init:
- pwsh: |
if ($env:APPVEYOR_REPO_BRANCH -ne 'master') {
Set-AppveyorBuildVariable 'CONFIGURATION' 'debug'
}
install:
- git submodule update --init --recursive
before_build:
- pwsh: |
gitversion /l console /output buildserver /verbosity quiet
if ($env:APPVEYOR_REPO_TAG -eq $false) {
Set-AppveyorBuildVariable -Name Configuration -Value debug
}
dotnet_csproj:
patch: true
file: src\ILLightenComparer\ILLightenComparer.csproj
version: $(GitVersion_NuGetVersion)
assembly_version: $(GitVersion_MajorMinorPatch)
file_version: $(GitVersion_MajorMinorPatch)
informational_version: $(GitVersion_InformationalVersion)
build_script:
- pwsh: |
Get-ChildItem Env: | Sort Name
dotnet build . -c $env:CONFIGURATION -v m
dotnet pack .\src\ILLightenComparer\ --include-source --include-symbols `
--no-build --no-dependencies -c $env:CONFIGURATION -v m -o publish
test_script:
- pwsh: |
if ($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) {
Get-ChildItem .\**\*.Tests.csproj -Recurse | ForEach-Object {
dotnet test $_ --no-build -c $env:CONFIGURATION
}
} else {
nuget install OpenCover -Verbosity quiet -Version 4.7.922
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
Get-ChildItem .\**\*.Tests.csproj -Recurse | ForEach-Object {
.\OpenCover.4.7.922\tools\OpenCover.Console.exe `
-register:user `
-target:"C:\Program Files\dotnet\dotnet.exe" `
-targetargs:"test $_ --no-restore -c debug" `
-output:"coverage.xml" `
-returntargetcode
if (!$?) {
throw "`nTests for $_ failed."
}
bash codecov.sh -f "coverage.xml" -t $env:OpenCoverToken
}
}
artifacts:
- path: .\publish\*.nupkg
name: nuget-package
type: NuGetPackage
nuget:
account_feed: false
project_feed: false
disable_publish_on_pr: true
disable_publish_octopus: true
deploy:
- provider: Environment
name: nuget-org
artifact: .\publish\*.nupkg
on:
APPVEYOR_REPO_TAG: true