forked from icsharpcode/SharpZipLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
73 lines (60 loc) · 2.14 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
version: '{build}'
image: Visual Studio 2017
configuration:
- Debug
- Release
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: $(VERSION)
package_version: $(VERSION)
assembly_version: 1.0.0.999
file_version: 1.0.0.999
informational_version: $(VERSION)
install:
- ps: |-
$commit = $(git rev-parse --short HEAD)
$masterBranches = @("master");
if ($masterBranches -contains $env:APPVEYOR_REPO_BRANCH) {
$branch = "";
} else {
$branch = "-$env:APPVEYOR_REPO_BRANCH";
}
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$suffix = "-pr$env:APPVEYOR_PULL_REQUEST_NUMBER";
} else {
$suffix = "";
}
$build = "_${env:APPVEYOR_BUILD_NUMBER}"
$version = "1.0-git$commit";
$av_version = "$version$branch$suffix$build";
$env:APPVEYOR_BUILD_VERSION=$av_version;
$env:VERSION=$version;
write-host -n "new version: ";
write-host -f green $av_version;
appveyor UpdateBuild -Version $av_version
nuget:
project_feed: true
disable_publish_on_pr: true
before_build:
- ps: nuget restore ICSharpCode.SharpZipLib.sln
build:
project: ICSharpCode.SharpZipLib.sln
publish_nuget: true
publish_nuget_symbols: true
verbosity: normal
test_script:
- ps: |-
$proj = ".\test\ICSharpCode.SharpZipLib.TestBootstrapper\ICSharpCode.SharpZipLib.TestBootstrapper.csproj";
$resxml = ".\docs\nunit3-test-results-debug.xml";
# Nuget 3 Console runner:
#$tester = "nunit3-console .\test\ICSharpCode.SharpZipLib.Tests\bin\$($env:CONFIGURATION)\netcoreapp2.0\ICSharpCode.SharpZipLib.Tests.dll"
# Bootstrapper:
$tester = "dotnet run -f netcoreapp2 -p $proj -c $env:CONFIGURATION";
iex "$tester --explore=tests.xml";
[xml]$xml = Get-Content("tests.xml");
$assembly = select-xml "/test-suite[@type='Assembly']" $xml | select -f 1 -exp Node;
$testcases = select-xml "//test-case" $xml | % { Add-AppveyorTest -Name $_.Node.fullname -Framework NUnit -Filename $assembly.name };
iex "$tester --result=$resxml";
$wc = New-Object 'System.Net.WebClient';
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $resxml));