This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
/
appveyor.yml
106 lines (90 loc) · 3.07 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
104
105
106
environment:
PKG_VERSION: 1.1.2
VERSION_SUFFIX: ""
version: ${PKG_VERSION}-{build}
configuration: Release
platform: x64
image: Visual Studio 2017
skip_commits:
message: /chore/
files:
- '**\*.md'
- LICENSE
skip_branch_with_pr: true
branches:
only:
- master
matrix:
fast_finish: true
init:
- git config --global core.autocrlf input
- ps: $env:BUILD_VERSION = "$env:PKG_VERSION-$env:APPVEYOR_BUILD_NUMBER"
- ps: |
if ($env:APPVEYOR_REPO_BRANCH -eq "master")
{
$env:VERSION_SUFFIX = ""
$env:NUGET_VERSION = "$env:PKG_VERSION"
}
else
{
$env:VERSION_SUFFIX = "beta$env:APPVEYOR_BUILD_NUMBER"
$env:NUGET_VERSION = "$env:PKG_VERSION-$env:VERSION_SUFFIX"
}
- ps: Update-AppveyorBuild -Version $env:BUILD_VERSION
- ps: Write-Host "Build version $env:BUILD_VERSION, NuGet version $env:NUGET_VERSION, Version suffix $env:VERSION_SUFFIX"
before_build:
- appveyor-retry dotnet restore -v Minimal
build_script:
- ps: |
if ($env:APPVEYOR_REPO_BRANCH -eq "master")
{
dotnet build "src\Multiformats.Codec" -c $env:CONFIGURATION
}
else
{
dotnet build "src\Multiformats.Codec" -c $env:CONFIGURATION --version-suffix $env:VERSION_SUFFIX
}
after_build:
- ps: |
if ($env:APPVEYOR_REPO_BRANCH -eq "master")
{
dotnet pack "src\Multiformats.Codec" -c $env:CONFIGURATION --no-build -o $env:APPVEYOR_BUILD_FOLDER\artifacts
}
else
{
dotnet pack "src\Multiformats.Codec" -c $env:CONFIGURATION --no-build --version-suffix $env:VERSION_SUFFIX -o $env:APPVEYOR_BUILD_FOLDER\artifacts
}
test: off
test_script:
- dotnet test --configuration Debug --framework netcoreapp2.1 --logger trx;logfilename=TestResult.xml --results-directory "%APPVEYOR_BUILD_FOLDER%\test\Multiformats.Codec.Tests\TestResults" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover "%APPVEYOR_BUILD_FOLDER%\test\Multiformats.Codec.Tests\Multiformats.Codec.Tests.csproj"
after_test:
- ps: |
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/xunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\Multiformats.Codec.Tests\TestResults\TestResult.xml))
on_success:
- choco install codecov
- codecov -f "%APPVEYOR_BUILD_FOLDER%\test\Multiformats.Codec.Tests\coverage.opencover.xml
artifacts:
- path: artifacts\**\*.*
cache:
- '%USERPROFILE%\.nuget\packages -> **\project.json'
- '%LocalAppData%\NuGet\Cache'
nuget:
account_feed: true
deploy:
- provider: NuGet
api_key:
secure: WcDqU36pLPvA+s5D4N0VEsi7AZGewvf4croE/D3rh3F+iqiztq9w5gHbrhgoTNS9
on:
branch: master
appveyor_repo_tag: true
- provider: GitHub
description: 'Release description'
auth_token:
secure: nsZHZ5nFBFP4fZoVUEeWeZKx7LUASVqCZ+JblTox+02RfTAOlANdFWeCqOwhu7pk
artifact: /.*\.nupkg/ # upload all NuGet packages to release assets
draft: false
prerelease: false
on:
branch: master # release from master branch only
appveyor_repo_tag: true