-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
117 lines (94 loc) · 3.61 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
107
108
109
110
111
112
113
114
115
116
117
version: '{build}.0.0-dev'
image: Ubuntu
pull_requests:
do_not_increment_build_number: true
environment:
PROJECT_NAME: SimpleGoogleWebServices
LIBRARY_PROJECT_FILE: 'src\%PROJECT_NAME%\%PROJECT_NAME%.csproj'
WEBSITE_PROJECT_FILE: 'src\%PROJECT_NAME%.WebApplication\%PROJECT_NAME%.WebApplication.csproj'
# Override the 'version' if this is a GH-tag-commit -or- this is a custom branch (i.e not 'master').
init:
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq $TRUE -and $env:APPVEYOR_REPO_BRANCH -eq 'master')
{
Write-Host " !! Commit is Tagged and branch is 'master' - forcing build version to tag-value." -ForegroundColor Red;
Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME"
}
iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/PureKrome/0f79e25693d574807939/raw/f5b40256fc2ca77d49f1c7773d28406152544c1e/appveyor-build-info.ps'))
matrix:
fast_finish: true
configuration:
- Debug
- Release
before_build:
# Display .NET Core version
- dotnet --info
build_script:
- dotnet restore --verbosity quiet
- ps: dotnet build -c $env:CONFIGURATION -v minimal /p:Version=$env:APPVEYOR_BUILD_VERSION --no-restore
test_script:
- ps: |
if ($env:CONFIGURATION -eq 'Debug')
{
dotnet test -c $env:CONFIGURATION -v minimal --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory './CodeCoverageResults'
}
else
{
dotnet test -c $env:CONFIGURATION -v minimal --no-build
}
# We only:
# - Send DEBUG results up to codecov.
# - Pack (a nuget package) for RELEASE only.
# - Publish the website for RELEASE onlu.
after_test:
- ps: |
if ($env:CONFIGURATION -eq 'Debug')
{
# Currently, the bash script version is better than the .exe version.
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
bash codecov.sh -s './CodeCoverageResults/' -f '*.xml' -Z
}
if ($env:CONFIGURATION -eq 'Release')
{
dotnet pack $env:LIBRARY_PROJECT_FILE -c $env:CONFIGURATION --no-build /p:ContinuousIntegrationBuild=true /p:Version=$env:APPVEYOR_BUILD_VERSION
dotnet publish $env:WEBSITE_PROJECT_FILE -c $env:CONFIGURATION -o $env:APPVEYOR_BUILD_FOLDER\website
}
artifacts:
- path: '**\*.nupkg'
name: nuget-packages
type: NuGetPackage
- path: '**\*.snupkg'
name: nuget-symbols
type: NuGetPackage
# Myget -> master and not tagged.
# Nuget -> master and tagged.
# Website -> master and tagged.
deploy:
# Myget doesn't support symbols
- provider: NuGet
server: https://www.myget.org/F/pk-development/api/v2/package
api_key:
secure: 36bcjhroAjclbHs7e7oh6Hsv4lokADI6xaQcCYZmux2Sdu/IIoktFc9ORK3DTdKo
skip_symbols: true
artifact: nuget-packages
on:
branch: master
APPVEYOR_REPO_TAG: false
# Both nupkg and snupkg
- provider: NuGet
api_key:
secure: jfcUvHZhgnUboplqTBDWr8mG5PIlrgBv5TA2fhhop4ZSiDxskyy+RtYyeHoduJFR
on:
branch: master
APPVEYOR_REPO_TAG: true
- provider: WebDeploy
server: https://simplegooglewebservices.scm.azurewebsites.net:443/msdeploy.axd?site=simplegooglewebservices
website: simplegooglewebservices
username: $simplegooglewebservices
artifact: website
password:
secure: rvFCJmVBnz01FENzKlIGspkXxrnr7/maYZyiR7GX54M08HD5TLOzjq878nl8W4kRwEkStO+AgLp3Y7BJU/ZYYQ==
remove_files: true
on:
branch: master
APPVEYOR_REPO_TAG: true