-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
91 lines (82 loc) · 3.01 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
version: 1.0.0-ci-{build}
image: Visual Studio 2019
pull_requests:
do_not_increment_build_number: false
branches:
only:
- main
skip_branch_with_pr: true
configuration: Release
environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
shallow_clone: true
init:
# Set "build version number"
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
try
{
Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME"
}
catch
{
Write-Output "Update-AppveyorBuild Fail to change version to TAG: '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Red
Write-Output "Exception Error: $PSItem.Exception.Message" -ForegroundColor Red
Write-Output "Exception Error: $PSItem.Exception.GetType().Name" -ForegroundColor Red
}
}
- ps: |
Write-Host "APPVEYOR_BUILD_VERSION='$env:APPVEYOR_BUILD_VERSION'" -ForegroundColor Yellow
Write-Host "APPVEYOR_REPO_TAG_NAME= '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Yellow
- cmd: dotnet --version
# install the tools
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet tool install -g dotnet-sonarscanner }'
# disable minicover
# - cmd: dotnet tool install -g minicover
# Disable skipping commints
# skip_commits:
# files:
# - samples/**/*
# - '**/*.md'
# - .gitignore
# - .editorconfig
# message: /updated readme.*|update readme.*s|update docs.*|update version.*|update changelog.*/
nuget:
project_feed: true
before_build:
- dotnet restore
build_script:
# Begin SonarScanner
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner begin /k:"HealthChecks.Extensions" /o:adrianiftode-github /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:SONAR_TOKEN" /v:"$env:APPVEYOR_BUILD_NUMBER" /d:sonar.cs.opencover.reportsPaths="opencovercoverage.xml" /d:sonar.coverage.exclusions=test/** /d:sonar.scanner.force-deprecated-java-version=true}'
- dotnet build -c %CONFIGURATION% /p:Version=%APPVEYOR_BUILD_VERSION%
# disable minicover
# - minicover instrument
test_script:
- dotnet test --no-restore --no-build
after_test:
- dotnet pack --no-build --include-symbols -c %CONFIGURATION% /p:PackageVersion=%APPVEYOR_BUILD_VERSION%
# disable minicover
# - minicover uninstrument
# - minicover opencoverreport
# will fail when the test coverage is lower than the threshold
# - minicover report --threshold 90
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner end /d:sonar.login="$env:SONAR_TOKEN" }'
artifacts:
- path: '**\*.nupkg'
name: NuGet
deploy:
- provider: NuGet
api_key:
secure: i1i67C8dR8UJ/KvlIHBjgJgWJ6GwzcmI/FqJSvFwL7e/1ECRF+jepJLlOVkMJ7L9
artifact: /.*HealthChecks.*\.nupkg/
on:
APPVEYOR_REPO_TAG: true
- provider: GitHub
release: $(APPVEYOR_BUILD_VERSION)
auth_token:
secure: P+6gIjiImV5sA83zi7YADnA09ftvhf/pwIgMXH15GLYXZDFKoHTnQIG/QiuaUd8f
artifact: /.*HealthChecks.*\.nupkg/
on:
APPVEYOR_REPO_TAG: true