@@ -10,6 +10,10 @@ skip_tags: true
10
10
clone_folder : C:\projects\libgit2sharp
11
11
12
12
environment :
13
+ coverity_token :
14
+ secure : nuzUT+HecXGIi3KaPd/1hgFEZJan/j6+oNbPV75JKjk=
15
+ coverity_email :
16
+ secure : eGVilNg1Yuq+Xj+SW8r3WCtjnzhoDV0sNJkma4NRq7A=
13
17
version : 0.22.0
14
18
matrix :
15
19
- xunit_runner : xunit.console.clr4.exe
@@ -22,23 +26,38 @@ matrix:
22
26
23
27
install :
24
28
- ps : |
25
- Write-Host "Commit being built = $($Env:APPVEYOR_REPO_COMMIT)"
26
- Write-Host "Current build version = $($Env:VERSION)"
27
- Write-Host "Target branch = $($Env:APPVEYOR_REPO_BRANCH)"
28
- Write-Host "Is a Pull Request = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null)"
29
+ Write-Host "Commit being built = " -NoNewLine
30
+ Write-Host $Env:APPVEYOR_REPO_COMMIT -ForegroundColor "Green"
31
+ Write-Host "Current build version = " -NoNewLine
32
+ Write-Host $Env:VERSION -ForegroundColor "Green"
33
+ Write-Host "Target branch = " -NoNewLine
34
+ Write-Host $Env:APPVEYOR_REPO_BRANCH -ForegroundColor "Green"
35
+ Write-Host "Is a Pull Request = " -NoNewLine
36
+ Write-Host $($Env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null) -ForegroundColor "Green"
37
+
29
38
$BuildDate = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss")
30
- Write-Host "Build UTC date = $BuildDate"
39
+ Write-Host "Build UTC date = " -NoNewLine
40
+ Write-Host $BuildDate -ForegroundColor "Green"
41
+
31
42
$VersionSuffix = ""
32
43
If ($Env:APPVEYOR_REPO_BRANCH -ne "master")
33
44
{
34
45
$VersionSuffix = "-pre$BuildDate"
35
46
}
36
47
$Version = "$($Env:VERSION)$($VersionSuffix)"
37
48
$Env:ASSEMBLY_INFORMATIONAL_VERSION = $Version
38
- Write-Host "Assembly informational version = $($Env:ASSEMBLY_INFORMATIONAL_VERSION)"
39
- $ShouldPublishNugetArtifact = "$($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)"
49
+ Write-Host "Assembly informational version = " -NoNewLine
50
+ Write-Host $Env:ASSEMBLY_INFORMATIONAL_VERSION -ForegroundColor "Green"
51
+
52
+ $ShouldPublishNugetArtifact = $($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)
40
53
$Env:SHOULD_PUBLISH_NUGET_ARTIFACT = $ShouldPublishNugetArtifact
41
- Write-Host "Should publish Nuget artifact = $($Env:SHOULD_PUBLISH_NUGET_ARTIFACT)"
54
+ Write-Host "Should publish Nuget artifact = " -NoNewLine
55
+ Write-Host $Env:SHOULD_PUBLISH_NUGET_ARTIFACT -ForegroundColor "Green"
56
+
57
+ $Env:SHOULD_PUBLISH_COVERITY_ANALYSIS = $($Env:APPVEYOR_SCHEDULED_BUILD -eq $True)
58
+ Write-Host "Should publish Coverity analysis = " -NoNewLine
59
+ Write-Host $Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -ForegroundColor "Green"
60
+
42
61
cinst sourcelink -y
43
62
44
63
assembly_info :
@@ -52,23 +71,62 @@ cache:
52
71
- packages
53
72
54
73
before_build :
55
- - nuget restore "% APPVEYOR_BUILD_FOLDER% \LibGit2Sharp.sln"
74
+ - ps : nuget restore "$Env: APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln"
56
75
57
76
build_script :
58
- - msbuild "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.sln" /verbosity:normal /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:ExtraDefine="LEAKS_IDENTIFYING"
77
+ - ps : |
78
+ & cov-build.exe --dir cov-int msbuild "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" `
79
+ /verbosity:normal `
80
+ /p:Configuration=Release `
81
+ /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" `
82
+ /property:ExtraDefine="LEAKS_IDENTIFYING"
59
83
60
84
test_script :
61
- - ' %xunit_runner% "%APPVEYOR_BUILD_FOLDER%\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor'
62
- - IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
85
+ - ps : |
86
+ If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
87
+ {
88
+ & "$Env:xunit_runner" "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" /appveyor
89
+ }
63
90
64
- on_success :
91
+ after_test :
65
92
- ps : |
66
- & "$env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" -commitSha "$env:APPVEYOR_REPO_COMMIT" -postBuild { sourcelink index -pr LibGit2Sharp.csproj -pp Configuration Release -nf Core\NativeDllName.cs -nf Core\UniqueIdentifier.cs -nf Properties\AssemblyInfo.cs -r .. -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
67
- Add-Type -Path "$env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
68
- Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
69
- If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
93
+ If ($Env:SHOULD_PUBLISH_COVERITY_ANALYSIS -eq $False)
70
94
{
71
- Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
95
+ & "$Env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" `
96
+ -commitSha "$Env:APPVEYOR_REPO_COMMIT" `
97
+ -postBuild { sourcelink index `
98
+ -pr LibGit2Sharp.csproj `
99
+ -pp Configuration Release `
100
+ -nf Core\NativeDllName.cs `
101
+ -nf Core\UniqueIdentifier.cs `
102
+ -nf Properties\AssemblyInfo.cs `
103
+ -r .. `
104
+ -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
105
+
106
+ Add-Type -Path "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
107
+ Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
108
+
109
+ If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
110
+ {
111
+ Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
112
+ }
113
+ }
114
+ Else
115
+ {
116
+ & nuget install PublishCoverity -Version 0.9.0 -ExcludeVersion -OutputDirectory .\packages
117
+
118
+ & .\packages\PublishCoverity\PublishCoverity.exe compress `
119
+ -i "$Env:APPVEYOR_BUILD_FOLDER\cov-int" `
120
+ -o "$Env:APPVEYOR_BUILD_FOLDER\$Env:APPVEYOR_PROJECT_NAME.zip"
121
+
122
+ & .\packages\PublishCoverity\PublishCoverity.exe publish `
123
+ -t "$Env:coverity_token" `
124
+ -e "$Env:coverity_email" `
125
+ -r "$Env:APPVEYOR_REPO_NAME" `
126
+ -z "$Env:APPVEYOR_BUILD_FOLDER\$env:APPVEYOR_PROJECT_NAME.zip" `
127
+ -d "CI server scheduled build." `
128
+ --codeVersion "$Env:ASSEMBLY_INFORMATIONAL_VERSION" `
129
+ --nologo
72
130
}
73
131
74
132
notifications :
0 commit comments