forked from MetacoSA/NBitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
103 lines (84 loc) · 3.53 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# 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
#---------------------------------#
# environment configuration #
#---------------------------------#
environment:
github_access_token:
secure: N2gnAR45uwx/+8B8yJY0K8cRFzpXm8W/e1nbsF6O+36h171tTBirkAgnDTfQiUtF
github_email:
secure: 7WEBdwurN3nc4zkdDPfkFIog4U14s5XhamiCk4oGvOY=
github_user: NicolasDorier
image: Visual Studio 2019
clone_folder: c:\projects\nbitcoin
clone_depth: 1
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 -v n ./NBitcoin.Tests/NBitcoin.Tests.csproj --filter "RestClient=RestClient|RPCClient=RPCClient|Protocol=Protocol|Core=Core|UnitTest=UnitTest|Altcoins=Altcoins" -p:ParallelizeTestCollections=false -f net461
Write-Host "[$env:configuration] FINISHED dotnet test" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
#---------------------------------#
# docs configuration #
#---------------------------------#
on_success:
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
Write-Host "Generating Docs"
cinst docfx
$env:MSBuildSDKsPath="C:\Program Files\dotnet\sdk\2.2.203\Sdks"
git config --global credential.helper store
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:github_access_token):[email protected]`n"
git config --global user.email $env:github_email
git config --global user.name $env:github_user
git config --global core.safecrlf false
sh ./docs/release.sh
}
else
{
Write-Host "Not a tagged build, skipping doc generation"
}
#---------------------------------#
#---------------------------------#
# artifacts configuration #
#---------------------------------#
# pushing all files in build directory recursively
artifacts:
- path: nuget\*.nupkg
name: nuget packages