-
Notifications
You must be signed in to change notification settings - Fork 1
/
.appveyor.yml
188 lines (157 loc) · 5.09 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# AppVeyor documentation https://www.appveyor.com/docs
configuration:
- Release
assembly_info:
patch: false
# Build script
version: '{build}'
image: Previous Visual Studio 2017
os: Previous Visual Studio 2017
# branches to build
branches:
# whitelist
only:
- /v\d+\.\d+\.\d+/
- master
except:
- develop
clone_depth: 1
environment:
global:
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
BUILD: $(APPVEYOR_BUILD_NUMBER)
COVERITY_EMAIL:
secure: xxx
COVERITY_TOKEN:
secure: xxx
GITHUB_TOKEN:
secure: tlnq8XIYBO8uf9X6Umt0ei09ldGB7E9hhxT8gLxsfm4fnt2ymz8M2uMVtA0jplPj
pull_requests:
# Do not increment build number for pull requests
do_not_increment_build_number: true
nuget:
# Do not publish NuGet packages for pull requests
disable_publish_on_pr: true
init:
- ps: |
If ($Env:APPVEYOR_REPO_TAG_NAME -match "-"){
$headers = @{
"Authorization" = "Bearer $env:GITHUB_TOKEN"
"Content-type" = "application/json"
}
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases" -Headers $headers -Method GET
$env:releaseDescription = ($releases | Where-Object {$_.name -eq "$env:APPVEYOR_REPO_TAG_NAME"}).body
Set-AppveyorBuildVariable -Name "IsPreRelease" -Value True
}
Else{
Set-AppveyorBuildVariable -Name "IsPreRelease" -Value False
}
# Good practise, because Windows line endings are different from Unix/Linux ones
- cmd: git config --global core.autocrlf true
install:
# .NET Core SDK binaries
- ps: $urlCurrent = "https://download.microsoft.com/download/8/8/5/88544F33-836A-49A5-8B67-451C24709A8F/dotnet-sdk-2.1.300-win-x64.zip"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
- ps: $tempFileCurrent = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName())
- ps: (New-Object System.Net.WebClient).DownloadFile($urlCurrent, $tempFileCurrent)
- ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFileCurrent, $env:DOTNET_INSTALL_DIR)
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
#---------------------------------#
# build configuration #
#---------------------------------#
before_build:
# Display .NET Core version
- cmd: dotnet --version
- choco install codecov
build_script:
- ps: .\build.ps1 --verbosity=diagnostic
- codecov -f .\artifacts\Coverage\coverage.xml -t $(CODECOV_TOKEN)
after_build:
# For once the build has completed
on_finish :
# any cleanup in here
#---------------------------------#
# tests configuration #
#---------------------------------#
test: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
# Store NuGet packages
- path: .\Artifacts\**\*.nupkg
name: NuGet
- path: .\Artifacts\**\*.zip
name: Zip
# Store xUnit Test Results
- path: .\Artifacts\**\coverage.xml
name: xUnit Test Results
#---------------------------------#
# deployment configuration #
#---------------------------------#
deploy:
- provider: GitHub
release: 'Release $(APPVEYOR_REPO_TAG_NAME) build $(APPVEYOR_BUILD_VERSION)'
description: '[**CHANGE LOG**](https://github.com/courio-dev/$(APPVEYOR_PROJECT_SLUG)/blob/master/HISTORY.md)'
artifact: Zip, NuGet
draft: false
prerelease: $(IsPreRelease)
force_update: true
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token: $(GITHUB_TOKEN)
on:
appveyor_repo_tag: true
# Deploying to MyGet feed
- provider: NuGet
name: development
server: https://www.myget.org/F/courio-dev/api/v2/package
api_key:
secure: 9uzkCroixqPrC9das6F7wx42qI+xXhfz+L0Bu4XPwxmIh8f+UrZGUEBwvsOrKzeg
skip_symbols: true
on:
# Only publish from the master branch
branch: master
# Deploying to NuGet feed
- provider: NuGet
name: production
api_key:
secure: hd7kH5D5DJr+IpC+9zAklVm9r5Pm0Ku0RbMaA7DmReouBhExmFBPTVe+rWtl9zRa
artifact: NuGet
skip_symbols: true
draft: false
prerelease: $(IsPreRelease)
force_update: true
tag: $(APPVEYOR_REPO_TAG_NAME)
on:
# Only publish if the trigger was a Git tag
# git tag v0.1.0-beta
# git push origin --tags
APPVEYOR_REPO_TAG: true
# scripts to run before deployment
before_deploy:
# scripts to run after deployment
#after_deploy:
#- ps: .\upload-test.ps1
# to run your custom scripts instead of provider deployments
deploy_script:
# to disable deployment
#deploy: off
#---------------------------------#
# global handlers #
#---------------------------------#
# on build failure
on_failure:
- do something
#---------------------------------#
# notifications #
#---------------------------------#
#---------------------------------#
# cache configuration #
#---------------------------------#
cache:
- tools -> build.cake
- packages -> build.cake