|
1 | 1 | version: '{build}' |
2 | 2 |
|
3 | | -os: Visual Studio 2015 |
| 3 | +os: Visual Studio 2017 |
4 | 4 |
|
5 | 5 | branches: |
6 | 6 | only: |
7 | 7 | - master |
8 | 8 | - /^maint.*/ |
9 | | - - portable |
| 9 | + - /portable.*/ |
| 10 | + |
| 11 | +configuration: release |
10 | 12 |
|
11 | 13 | skip_tags: true |
12 | 14 |
|
13 | | -clone_folder: C:\projects\libgit2sharp |
| 15 | +nuget: |
| 16 | + disable_publish_on_pr: true |
14 | 17 |
|
15 | 18 | environment: |
16 | 19 | coveralls_token: |
@@ -61,94 +64,55 @@ install: |
61 | 64 | Write-Host "Should run Coverity analysis = " -NoNewLine |
62 | 65 | Write-Host $Env:SHOULD_RUN_COVERITY_ANALYSIS -ForegroundColor "Green" |
63 | 66 |
|
64 | | - $Env:SHOULD_PACKAGE_NUGET_ARTIFACT = -not $Env:APPVEYOR_PULL_REQUEST_NUMBER -and -not $Env:APPVEYOR_SCHEDULED_BUILD |
65 | | - Write-Host "Should package Nuget artifact = " -NoNewLine |
66 | | - Write-Host $Env:SHOULD_PACKAGE_NUGET_ARTIFACT -ForegroundColor "Green" |
67 | | -
|
68 | 67 | $Env:SHOULD_RUN_COVERALLS = $($Env:APPVEYOR_SCHEDULED_BUILD -eq $True) |
69 | 68 | Write-Host "Should run Coveralls = " -NoNewLine |
70 | 69 | Write-Host $Env:SHOULD_RUN_COVERALLS -ForegroundColor "Green" |
71 | 70 |
|
72 | 71 | Write-Host "Should publish on success = " -NoNewLine |
73 | 72 | Write-Host $Env:publish_on_success -ForegroundColor "Green" |
74 | 73 |
|
75 | | - If ($Env:SHOULD_PACKAGE_NUGET_ARTIFACT -eq $True) |
76 | | - { |
77 | | - cinst sourcelink -y |
78 | | - } |
79 | | -
|
80 | 74 | If ($Env:SHOULD_RUN_COVERALLS -eq $True) |
81 | 75 | { |
82 | | - lib\nuget\nuget.exe install OpenCover -Version 4.6.166 -ExcludeVersion -OutputDirectory .\packages |
83 | | - lib\nuget\nuget.exe install coveralls.net -Version 0.6.0 -ExcludeVersion -OutputDirectory .\packages |
| 76 | + nuget install OpenCover -Version 4.6.166 -ExcludeVersion -OutputDirectory .\packages |
| 77 | + nuget install coveralls.net -Version 0.6.0 -ExcludeVersion -OutputDirectory .\packages |
84 | 78 | } |
85 | 79 |
|
86 | 80 | If ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $True) |
87 | 81 | { |
88 | 82 | cinst curl -y |
89 | 83 | } |
90 | 84 |
|
91 | | -assembly_info: |
92 | | - patch: true |
93 | | - file: LibGit2Sharp.Shared\Properties\AssemblyInfo.cs |
94 | | - assembly_version: '$(VERSION)' |
95 | | - assembly_file_version: '$(VERSION)' |
96 | | - assembly_informational_version: '$(ASSEMBLY_INFORMATIONAL_VERSION)' |
97 | | - |
98 | | -cache: |
99 | | - - packages |
100 | | - |
101 | 85 | before_build: |
102 | 86 | - ps: | |
103 | | - & "$Env:APPVEYOR_BUILD_FOLDER\lib\nuget\nuget.exe" restore "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" |
| 87 | + dotnet restore |
104 | 88 |
|
105 | 89 | build_script: |
106 | 90 | - ps: | |
107 | | - & msbuild "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" ` |
| 91 | + dotnet msbuild "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.sln" ` |
108 | 92 | /verbosity:normal ` |
109 | | - /p:Configuration=Release ` |
110 | | - /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ` |
111 | | - /property:ExtraDefine="LEAKS_IDENTIFYING" |
| 93 | + /property:ExtraDefine="LEAKS_IDENTIFYING" ` |
| 94 | + /t:build,pack |
112 | 95 |
|
113 | 96 | test_script: |
114 | 97 | - ps: | |
115 | 98 | If ($Env:SHOULD_RUN_COVERALLS -eq $True -and $Env:publish_on_success -eq $True) |
116 | 99 | { |
117 | 100 | .\packages\OpenCover\tools\OpenCover.Console.exe ` |
118 | 101 | -register:user ` |
119 | | - "-target:""$Env:APPVEYOR_BUILD_FOLDER\packages\xunit.runner.console.2.0.0\tools\$Env:xunit_runner""" ` |
120 | | - "-targetargs:""$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll"" -noshadow" ` |
| 102 | + "-target:""$Env:userprofile\.nuget\packages\xunit.runner.console\2.0.0\tools\$Env:xunit_runner""" ` |
| 103 | + "-targetargs:""$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\net46\LibGit2Sharp.Tests.dll"" -noshadow" ` |
121 | 104 | "-filter:+[LibGit2Sharp]* -[LibGit2Sharp.Tests]*" ` |
122 | 105 | -hideskipped:All ` |
123 | 106 | -output:opencoverCoverage.xml |
124 | 107 | } |
125 | 108 | ElseIf ($Env:SHOULD_RUN_COVERITY_ANALYSIS -eq $False) |
126 | 109 | { |
127 | | - & "$Env:APPVEYOR_BUILD_FOLDER\packages\xunit.runner.console.2.0.0\tools\$Env:xunit_runner" ` |
128 | | - "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\LibGit2Sharp.Tests.dll" -noshadow |
| 110 | + & "$Env:userprofile\.nuget\packages\xunit.runner.console\2.0.0\tools\$Env:xunit_runner" ` |
| 111 | + "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp.Tests\bin\Release\net46\LibGit2Sharp.Tests.dll" -noshadow |
129 | 112 | } |
130 | 113 |
|
131 | 114 | after_test: |
132 | 115 | - ps: | |
133 | | - If ($Env:SHOULD_PACKAGE_NUGET_ARTIFACT -eq $True -and $Env:publish_on_success -eq $True) |
134 | | - { |
135 | | - & "$Env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" ` |
136 | | - -commitSha "$Env:APPVEYOR_REPO_COMMIT" ` |
137 | | - -postBuild { sourcelink index ` |
138 | | - -pr LibGit2Sharp.csproj ` |
139 | | - -pp Configuration Release ` |
140 | | - -nf Core\NativeDllName.cs ` |
141 | | - -nf Core\UniqueIdentifier.cs ` |
142 | | - -nf Properties\AssemblyInfo.cs ` |
143 | | - -r .. ` |
144 | | - -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' } |
145 | | -
|
146 | | - Add-Type -Path "$Env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll" |
147 | | - Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta" |
148 | | -
|
149 | | - Get-ChildItem "$Env:APPVEYOR_BUILD_FOLDER\LibGit2sharp\*.nupkg" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } |
150 | | - } |
151 | | -
|
152 | 116 | If ($Env:SHOULD_RUN_COVERALLS -eq $True -and $Env:publish_on_success -eq $True) |
153 | 117 | { |
154 | 118 | Write-Host "Uploading code coverage result..." -ForegroundColor "Green" |
@@ -181,6 +145,10 @@ after_test: |
181 | 145 | cat .\curl-out.txt |
182 | 146 | } |
183 | 147 |
|
| 148 | +artifacts: |
| 149 | +- path: '**\bin\**\*.nupkg' |
| 150 | + name: NuGet Package |
| 151 | + |
184 | 152 | notifications: |
185 | 153 | - provider: Email |
186 | 154 | to: |
|
0 commit comments