forked from ektrah/libsodium-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
106 lines (92 loc) · 3.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
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.2.3
VERSION_SUFFIX: ""
version: ${PKG_VERSION}-{build}
configuration: Release
platform: x64
image: Visual Studio 2019
skip_commits:
message: /chore/
files:
- '**\*.md'
- LICENSE
skip_branch_with_pr: true
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")
{
msbuild /t:build "src\Sodium.Core" /p:Configuration=$env:CONFIGURATION
}
else
{
msbuild /t:build "src\Sodium.Core" /p:Configuration=$env:CONFIGURATION /p:version-suffix=$env:VERSION_SUFFIX
}
after_build:
- ps: |
if ($env:APPVEYOR_REPO_BRANCH -eq "master")
{
msbuild /t:pack "src\Sodium.Core" /p:Configuration=$env:CONFIGURATION /p:NoBuild=true /p:PackageOutputPath=$env:APPVEYOR_BUILD_FOLDER\artifacts
}
else
{
msbuild /t:pack "src\Sodium.Core" /p:Configuration=$env:CONFIGURATION /p:NoBuild=true /p:version-suffix=$env:VERSION_SUFFIX /p:PackageOutputPath=$env:APPVEYOR_BUILD_FOLDER\artifacts
}
test: off
test_script:
- dotnet test --configuration Debug --framework netcoreapp2.0 --logger trx;logfilename=TestResult.xml --results-directory "%APPVEYOR_BUILD_FOLDER%\test\Sodium.Tests\TestResults" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover %APPVEYOR_BUILD_FOLDER%\test\Sodium.Tests\Sodium.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\Sodium.Tests\TestResults\TestResult*.xml))
on_success:
- choco install codecov
- codecov -f "%APPVEYOR_BUILD_FOLDER%\test\Sodium.Tests\coverage.xml"
artifacts:
- path: artifacts\**\*.*
cache:
- '%USERPROFILE%\.local'
- '%USERPROFILE%\.nuget\packages -> **\*.csproj'
- '%LocalAppData%\NuGet\Cache'
- '%LocalAppData%\Python'
- '.\packages -> **\*.csproj'
- '.\tools'
- '\Python34'
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