forked from danielpalme/ReportGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
255 lines (221 loc) · 7.55 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
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
pool:
vmImage: 'windows-2019'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
disable.coverage.autogenerate: 'true'
version: '4.4.0'
# Prepare
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet info'
inputs:
command: custom
custom: '--info'
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 2.2.402'
inputs:
packageType: sdk
version: 2.2.402
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1.100'
inputs:
packageType: sdk
version: 3.1.100
- 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
inputs:
restoreSolution: '$(solution)'
# Build
- 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: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'
# Publish artifacts
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: packages'
inputs:
ArtifactName: packages