1
- version : 1.1 .{build}
2
- image : Visual Studio 2019
1
+ version : 1.2 .{build}
2
+ image : Visual Studio 2022
3
3
branches :
4
4
only :
5
5
- master
6
+ - /\d+\.\d+\.\d+/
6
7
pull_requests :
7
- do_not_increment_build_number : true
8
+ do_not_increment_build_number : false
9
+ skip_branch_with_pr : true
8
10
configuration : Release
9
11
shallow_clone : true
10
12
@@ -18,6 +20,23 @@ skip_commits:
18
20
19
21
init :
20
22
- cmd : dotnet --version
23
+ - ps : |
24
+ if ($env:APPVEYOR_REPO_TAG -eq "true")
25
+ {
26
+ try
27
+ {
28
+ Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME"
29
+ }
30
+ catch
31
+ {
32
+ Write-Output "Update-AppveyorBuild Fail to change version to TAG: '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Red
33
+ Write-Output "Exception Error: $PSItem.Exception.Message" -ForegroundColor Red
34
+ Write-Output "Exception Error: $PSItem.Exception.GetType().Name" -ForegroundColor Red
35
+ }
36
+ }
37
+ - ps : |
38
+ Write-Host "APPVEYOR_BUILD_VERSION='$env:APPVEYOR_BUILD_VERSION'" -ForegroundColor Yellow
39
+ Write-Host "APPVEYOR_REPO_TAG_NAME= '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Yellow
21
40
- ps : ' if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet tool install -g dotnet-sonarscanner }'
22
41
- cmd : dotnet tool install -g minicover
23
42
@@ -36,22 +55,22 @@ nuget:
36
55
before_build :
37
56
- dotnet restore
38
57
build_script :
39
- # Ensure Java 11, required by Sonar
40
- - set JAVA_HOME=C:\Program Files\Java\jdk11
58
+ # Ensure Java 15, required by Sonar
59
+ - set JAVA_HOME=C:\Program Files\Java\jdk19
60
+ - if not exist "%JAVA_HOME%\bin\java.exe" (echo "%JAVA_HOME%\bin\java.exe does not exist" && exit 1)
41
61
- set PATH=%JAVA_HOME%\bin;%PATH%
42
- # Begin SonarScanner
43
- - ps : ' if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner begin /k:"Moq.ILogger" /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/**}'
44
- - dotnet build
62
+ - ps : ' if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner begin /k:"adrianiftode_FluentAssertions.Web" /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/**}'
63
+ - dotnet build -c %CONFIGURATION% /p:Version=%APPVEYOR_BUILD_VERSION%
45
64
- minicover instrument
46
65
test_script :
47
- - dotnet test --no-restore --no-build
66
+ - dotnet test --no-restore --no-build --nologo --verbosity:q
48
67
after_test :
49
68
- minicover uninstrument
50
69
- minicover opencoverreport
51
70
# will fail when the test coverage is lower than the threshold
52
71
- minicover report --threshold 90
53
72
- ps : ' if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner end /d:sonar.login="$env:SONAR_TOKEN" }'
54
- - dotnet pack --no-restore --include-symbols -c %CONFIGURATION%
73
+ - dotnet pack --no-build --include-symbols -c %CONFIGURATION% /p:PackageVersion=%APPVEYOR_BUILD_VERSION %
55
74
56
75
artifacts :
57
76
- path : ' **\*.nupkg'
@@ -60,8 +79,16 @@ artifacts:
60
79
deploy :
61
80
- provider : NuGet
62
81
api_key :
63
- secure : O+eAN9xt6vbmeNTfpqoQ5c64xbzUCXrZXhJU6/3Vw9BvSn747F9PH5tFtuxEqLTA
82
+ secure : DbQndcBhytd1c9OjkuTZDytpWBemxjl0eskUAhXO6y4L0TdjH2H6SubzOnWCH7bD
64
83
skip_symbols : true
65
84
artifact : /.*\.nupkg/
66
- on :
67
- branch : master
85
+ on :
86
+ appveyor_repo_tag : true
87
+
88
+ - provider : GitHub
89
+ release : $(APPVEYOR_BUILD_VERSION)
90
+ auth_token :
91
+ secure : WXU/Xj3ntIZVx89KDAa/V9FszL7l3pOFpFdWVEsKggcn7bGviwOOpm9RSxZ7q+biREJXWL+1hYhcXQltmQDbaX7ga5jNMGyFFWpIWSDpb8x+1Aeg10fZX1SEWQ0t6VUr
92
+ artifact : /.*\.nupkg/
93
+ on :
94
+ appveyor_repo_tag : true
0 commit comments