forked from MetacoSA/NBitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
76 lines (61 loc) · 2.48 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
74
75
76
# reference: https://www.appveyor.com/docs/appveyor-yml/
# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}
version: 4.0.0.{build}
pull_requests:
do_not_increment_build_number: true
skip_tags: true
# branches to build
branches:
# whitelist
only:
- master
#---------------------------------#
# environment configuration #
#---------------------------------#
image: Visual Studio 2017
clone_folder: c:\projects\nbitcoin
configuration:
- Release
init:
- ps: dotnet --info
#---------------------------------#
# build configuration #
#---------------------------------#
before_build:
- ps: |
Write-Host "[$env:configuration] STARTED dotnet restore" -foregroundcolor "magenta"
dotnet restore -v m
Write-Host "[$env:configuration] FINISHED dotnet restore" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
build_script:
- ps: |
Write-Host "[$env:configuration] STARTED dotnet build" -foregroundcolor "magenta"
dotnet msbuild /p:Configuration=$env:configuration /p:Version=$env:APPVEYOR_BUILD_VERSION
Write-Host "[$env:configuration] FINISHED dotnet build" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# scripts to run after build
after_build:
- ps: |
if($env:configuration -eq 'Release')
{
Write-Host "[$env:configuration] STARTED dotnet pack" -foregroundcolor "magenta"
cd NBitcoin
dotnet pack -c $env:configuration -v m --no-build -o $env:APPVEYOR_BUILD_FOLDER\nuget\
Write-Host "[$env:configuration] FINISHED dotnet pack" -foregroundcolor "magenta"
}
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
test_script:
- ps: |
Write-Host "[$env:configuration] STARTED dotnet test" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER
dotnet test -c Release ./NBitcoin.Tests/NBitcoin.Tests.csproj --filter "RestClient=RestClient|RPCClient=RPCClient|Protocol=Protocol|Core=Core|UnitTest=UnitTest" -p:ParallelizeTestCollections=false
Write-Host "[$env:configuration] FINISHED dotnet test" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
#---------------------------------#
# artifacts configuration #
#---------------------------------#
# pushing all files in build directory recursively
artifacts:
- path: nuget\*.nupkg
name: nuget packages