Skip to content

Commit 5578c8f

Browse files
authored
Merge PR #246, Add new appveyor.yml
Correctly works with the new SDK .csproj format and netcore2 testing (unsupported by appveyor?) Builds nuget packages with the commit as the suffix.
1 parent a8f1741 commit 5578c8f

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

appveyor.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
version: '{build}'
2+
image: Visual Studio 2017
3+
configuration:
4+
- Debug
5+
- Release
6+
dotnet_csproj:
7+
patch: true
8+
file: '**\*.csproj'
9+
version: $(VERSION)
10+
package_version: $(VERSION)
11+
assembly_version: 1.0.0.999
12+
file_version: 1.0.0.999
13+
informational_version: $(VERSION)
14+
install:
15+
- ps: |-
16+
$commit = $(git rev-parse --short HEAD)
17+
18+
$masterBranches = @("master");
19+
20+
if ($masterBranches -contains $env:APPVEYOR_REPO_BRANCH) {
21+
$branch = "";
22+
} else {
23+
$branch = "-$env:APPVEYOR_REPO_BRANCH";
24+
}
25+
26+
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
27+
$suffix = "-pr$env:APPVEYOR_PULL_REQUEST_NUMBER";
28+
} else {
29+
$suffix = "";
30+
}
31+
32+
$build = "_${env:APPVEYOR_BUILD_NUMBER}"
33+
34+
$version = "1.0-git$commit";
35+
36+
$av_version = "$version$branch$suffix$build";
37+
$env:APPVEYOR_BUILD_VERSION=$av_version;
38+
$env:VERSION=$version;
39+
40+
write-host -n "new version: ";
41+
write-host -f green $av_version;
42+
43+
appveyor UpdateBuild -Version $av_version
44+
nuget:
45+
project_feed: true
46+
disable_publish_on_pr: true
47+
before_build:
48+
- ps: nuget restore ICSharpCode.SharpZipLib.sln
49+
build:
50+
project: ICSharpCode.SharpZipLib.sln
51+
publish_nuget: true
52+
publish_nuget_symbols: true
53+
verbosity: normal
54+
test_script:
55+
- ps: |-
56+
$proj = ".\test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj";
57+
$resxml = ".\docs\nunit3-test-results-debug.xml";
58+
59+
# Nuget 3 Console runner:
60+
#$tester = "nunit3-console .\test\ICSharpCode.SharpZipLib.Tests\bin\$($env:CONFIGURATION)\netcoreapp2.0\ICSharpCode.SharpZipLib.Tests.dll"
61+
62+
# Bootstrapper:
63+
$tester = "dotnet run -f netcoreapp2 -p $proj -c $env:CONFIGURATION";
64+
iex "$tester --explore=tests.xml";
65+
66+
[xml]$xml = Get-Content("tests.xml");
67+
$assembly = select-xml "/test-suite[@type='Assembly']" $xml | select -f 1 -exp Node;
68+
$testcases = select-xml "//test-case" $xml | % { Add-AppveyorTest -Name $_.Node.fullname -Framework NUnit -Filename $assembly.name };
69+
70+
iex "$tester --result=$resxml";
71+
72+
$wc = New-Object 'System.Net.WebClient';
73+
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $resxml));

0 commit comments

Comments
 (0)