-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-build.yaml
94 lines (80 loc) · 2.38 KB
/
azure-build.yaml
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
trigger:
branches:
include:
- master
- refs/tags/*
pr:
- master
pool:
vmImage: 'windows-2019'
variables:
buildConfiguration: 'Release'
buildPlatform: 'Any CPU'
solution: '**/*.sln'
steps:
# Prepare
- task: DotNetCoreCLI@2
displayName: 'dotnet info'
inputs:
command: custom
custom: '--info'
- task: DotNetCoreCLI@2
displayName: 'dotnet version'
inputs:
command: custom
custom: '--version'
- task: UseDotNet@2
displayName: 'Use .NET 5.0 sdk'
inputs:
packageType: sdk
version: 5.0.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: NuGetToolInstaller@1
displayName: 'Use NuGet 5.8.0'
inputs:
versionSpec: 5.8.0
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
# Build
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
arguments: '--output $(Build.ArtifactStagingDirectory)'
# # run tests and create coverage report
# - task: dotnetcorecli@2
# displayname: test
# inputs:
# command: test
# arguments: '--configuration $(buildconfiguration) /p:collectcoverage=true /p:coverletoutputformat=cobertura'
# projects: 'tests/**/*.csproj'
# nobuild: true
# - task: palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
# displayname: reportgenerator
# inputs:
# reports: '$(build.sourcesdirectory)/tests/**/coverage.cobertura.xml'
# targetdir: '$(build.sourcesdirectory)/codecoverage'
# reporttypes: 'htmlinline_azurepipelines;cobertura;badges'
# assemblyfilters: '-xunit*'
# - task: publishcodecoverageresults@1
# displayname: 'publish code coverage'
# inputs:
# codecoveragetool: cobertura
# summaryfilelocation: '$(build.sourcesdirectory)/codecoverage/cobertura.xml'
# # reportdirectory: '$(build.sourcesdirectory)/codecoverage'
- task: CopyFiles@2
displayName: 'Copy *.nupkg Files'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**\*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)\Package'
flattenFolders: true
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
# Publish
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\Package'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))