forked from danielpalme/ReportGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
328 lines (289 loc) · 10.9 KB
/
azure-pipelines.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
pool:
vmImage: 'windows-latest'
variables:
- group: 'FtpSettings' # variable group
- name: solution
value: '**/*.sln'
- name: buildPlatform
value: 'Any CPU'
- name: buildConfiguration
value: 'Release'
- name: disable.coverage.autogenerate
value: 'true'
- name: version
value: '4.6.3'
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet info'
inputs:
command: custom
custom: '--info'
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1.302'
inputs:
packageType: sdk
version: 3.1.302
- task: DotNetCoreCLI@2
displayName: 'dotnet info'
inputs:
command: custom
custom: '--info'
- task: DotNetCoreCLI@2
displayName: 'dotnet version'
inputs:
command: custom
custom: '--version'
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 5.3.0'
inputs:
versionSpec: 5.3.0
- task: NuGetCommand@2
displayName: 'NuGet Restore'
inputs:
restoreSolution: '$(solution)'
feedsToUse: config
nugetConfigPath: 'src/NuGet.Config'
# Compile
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish Console.NetCore 2.0'
inputs:
command: publish
publishWebProjects: false
arguments: '-c $(BuildConfiguration) -f netcoreapp2.0 ReportGenerator.Console.NetCore.csproj'
zipAfterPublish: false
modifyOutputPath: false
workingDirectory: src/ReportGenerator.Console.NetCore
- task: DotNetCoreCLI@2
displayName: 'dotnet publish Console.NetCore 2.1'
inputs:
command: publish
publishWebProjects: false
arguments: '-c $(BuildConfiguration) -f netcoreapp2.1 ReportGenerator.Console.NetCore.csproj'
zipAfterPublish: false
modifyOutputPath: false
workingDirectory: src/ReportGenerator.Console.NetCore
- task: DotNetCoreCLI@2
displayName: 'dotnet publish Console.NetCore 3.0'
inputs:
command: publish
publishWebProjects: false
arguments: '-c $(BuildConfiguration) -f netcoreapp3.0 ReportGenerator.Console.NetCore.csproj'
zipAfterPublish: false
modifyOutputPath: false
workingDirectory: src/ReportGenerator.Console.NetCore
- task: DotNetCoreCLI@2
displayName: 'dotnet publish ReportGenerator.DotnetCliTool 2.1'
inputs:
command: publish
publishWebProjects: false
arguments: '-c $(BuildConfiguration) ReportGenerator.DotnetCliTool.csproj'
zipAfterPublish: false
modifyOutputPath: false
workingDirectory: src/ReportGenerator.DotnetCliTool
- task: DotNetCoreCLI@2
displayName: 'dotnet publish DotnetGlobalTool 2.1'
inputs:
command: publish
publishWebProjects: false
arguments: '-c $(BuildConfiguration) -f netcoreapp2.1 ReportGenerator.DotnetGlobalTool.csproj'
zipAfterPublish: false
modifyOutputPath: false
workingDirectory: src/ReportGenerator.DotnetGlobalTool
- task: DotNetCoreCLI@2
displayName: 'dotnet publish DotnetGlobalTool 3.0'
inputs:
command: publish
publishWebProjects: false
arguments: '-c $(BuildConfiguration) -f netcoreapp3.0 ReportGenerator.DotnetGlobalTool.csproj'
zipAfterPublish: false
modifyOutputPath: false
workingDirectory: src/ReportGenerator.DotnetGlobalTool
# Run tests and create coverage report'
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: 'src\ReportGenerator.Core.Test\ReportGenerator.Core.Test.csproj'
arguments: '--configuration $(BuildConfiguration) --no-build /p:CollectCoverage=true /p:DeterministicSourcePaths=true /p:IncludeTestAssembly=true /p:CoverletOutputFormat=opencover%2ccobertura /p:CoverletOutput=../target/reports/coverage/'
- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
displayName: ReportGenerator
inputs:
reports: 'src\target\reports\coverage\coverage.opencover.xml'
targetdir: 'src\target\reports\coverage'
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
assemblyfilters: '-xunit*'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(build.sourcesdirectory)\src\target\reports\coverage\coverage.cobertura.xml'
reportDirectory: '$(build.sourcesdirectory)\src\target\reports\coverage'
# Create artifacts
- task: CopyFiles@2
displayName: 'Prepare VSIX release: NetCore'
inputs:
SourceFolder: src/ReportGenerator.Console.NetCore/bin/Release/netcoreapp2.1/publish
Contents: '**/*.*'
TargetFolder: src/AzureDevopsTask/ReportGenerator/tools/netcoreapp2.1
- task: Npm@1
displayName: 'Prepare VSIX release: Install TFS Cross Platform Command Line Interface (tfx-cli)'
inputs:
workingDir: src/AzureDevopsTask
verbose: false
- task: Npm@1
displayName: 'Prepare VSIX release: npm install'
inputs:
workingDir: src/AzureDevopsTask/ReportGenerator
verbose: false
- task: Npm@1
displayName: 'Prepare VSIX release: Compile TypeScript'
inputs:
command: custom
workingDir: src/AzureDevopsTask/ReportGenerator
verbose: false
customCommand: 'run tsc --'
- task: Npm@1
displayName: 'Create VSIX release'
inputs:
command: custom
workingDir: src/AzureDevopsTask
verbose: false
customCommand: 'run tfx -- extension create --manifest-globs vss-extension.json --output-path $(Build.ArtifactStagingDirectory)/vsix'
- task: CopyFiles@2
displayName: 'Prepare ZIP release: Basicfiles'
inputs:
SourceFolder: src/ReportGenerator.Console/bin/Release
Contents: |
LICENSE.txt
Readme.txt
TargetFolder: tmpzip
- task: CopyFiles@2
displayName: 'Prepare ZIP release: Net47'
inputs:
SourceFolder: src/ReportGenerator.Console/bin/Release
Contents: |
appsettings.json
*.dll
ReportGenerator.exe
ReportGenerator.exe.config
TargetFolder: tmpzip/net47
- task: CopyFiles@2
displayName: 'Prepare ZIP release: NetCore 2.0'
inputs:
SourceFolder: src/ReportGenerator.Console.NetCore/bin/Release/netcoreapp2.0/publish
Contents: '**/*.*'
TargetFolder: tmpzip/netcoreapp2.0
- task: CopyFiles@2
displayName: 'Prepare ZIP release: NetCore 2.1'
inputs:
SourceFolder: src/ReportGenerator.Console.NetCore/bin/Release/netcoreapp2.1/publish
Contents: '**/*.*'
TargetFolder: tmpzip/netcoreapp2.1
- task: CopyFiles@2
displayName: 'Prepare ZIP release: NetCore 3.0'
inputs:
SourceFolder: src/ReportGenerator.Console.NetCore/bin/Release/netcoreapp3.0/publish
Contents: '**/*.*'
TargetFolder: tmpzip/netcoreapp3.0
- task: ArchiveFiles@2
displayName: 'Pack ZIP release'
inputs:
rootFolderOrFile: tmpzip
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/zip/ReportGenerator_$(Version).zip'
- task: NuGetCommand@2
displayName: 'NuGet pack'
inputs:
command: pack
packagesToPack: 'src/Deployment/nuget/*.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)/nuget'
versioningScheme: byEnvVar
versionEnvVar: Version
- script: 'mkdir $(Build.ArtifactStagingDirectory)\chocolatey'
displayName: 'Prepare Chocolatey pack'
- task: gep13.chocolatey-azuredevops.chocolatey-azuredevops.ChocolateyCommand@0
displayName: 'Chocolatey pack'
inputs:
packWorkingDirectory: src/Deployment/chocolatey
packNuspecFileName: reportgenerator.portable.nuspec
packVersion: $(Version)
packOutputDirectory: '$(Build.ArtifactStagingDirectory)/chocolatey'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: packages'
inputs:
ArtifactName: packages
- stage: Deployment
condition: eq(variables['build.sourceBranch'], 'refs/heads/master')
jobs:
- deployment: Deployment
environment: 'Deployment'
strategy:
runOnce:
deploy:
steps:
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 5.3.0'
inputs:
versionSpec: 5.3.0
- task: GitHubRelease@1
displayName: 'GitHub release (create)'
inputs:
gitHubConnection: Github
repositoryName: danielpalme/ReportGenerator
tagSource: userSpecifiedTag
tag: 'v$(Version)'
title: 'ReportGenerator_$(Version)'
releaseNotesSource: inline
releaseNotesInline: 'This release requires .NET 4.7 or .NET Core 2.x/3.x.'
assets: '../packages/zip/ReportGenerator_*.zip'
continueOnError: true
- task: FtpUpload@1
displayName: 'FTP Upload: ZIP Release'
inputs:
credentialsOption: inputs
serverUrl: '$(ftpHost)'
username: '$(ftpUser)'
password: '$(ftpPassword)'
rootDirectory: '../packages/zip'
filePatterns: 'ReportGenerator_*.zip'
remoteDirectory: /
cleanContents: true
continueOnError: true
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '../packages/nuget/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: Nuget.org
continueOnError: true
- task: ms-devlabs.vsts-developer-tools-build-tasks.tfx-installer-build-task.TfxInstaller@2
displayName: 'Use Node CLI for Azure DevOps (tfx-cli): v0.7.x'
inputs:
version: v0.7.x
- task: ms-devlabs.vsts-developer-tools-build-tasks.publish-extension-build-task.PublishAzureDevOpsExtension@2
displayName: 'Publish Extension'
inputs:
connectedServiceName: 'Visual Studio Marketplace'
fileType: vsix
vsixFile: '../packages/vsix/Palmmedia.reportgenerator-*.vsix'
updateTasksVersion: false
continueOnError: true
- task: gep13.chocolatey-azuredevops.chocolatey-azuredevops.ChocolateyCommand@0
displayName: 'Chocolatey push'
inputs:
command: push
pushOperation: multiple
pushWorkingDirectory: '../packages/chocolatey'
chocolateySourceType: stored
externalEndpoint: Chocolatey
continueOnError: true