-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
57 lines (53 loc) · 1.75 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
variables:
- name: BuildParameters.solution
value: '**\*.sln'
- name: TestProject
value: '**/*UnitTests.csproj'
name: $(Major).$(Minor).$(Patch).$(Build)
trigger:
- main
pool:
vmImage: windows-latest
steps:
- task: DotNetCoreCLI@2
displayName: "Build Solution"
inputs:
command: 'build'
projects: $(BuildParameters.solution)
configuration: $(BuildConfiguration)
- task: DotNetCoreCLI@2
displayName: "Run Unit Tests"
inputs:
command: 'test'
projects: $(TestProject)
arguments: '--configuration $(buildConfiguration) --collect:"XPlat Code Coverage"'
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: $(Agent.TempDirectory)/*/coverage.cobertura.xml # using ** instead of * finds duplicate coverage
# Workaraound for the pack command not accepting arguments
# https://github.com/microsoft/azure-pipelines-tasks/issues/11640
- task: DotNetCoreCLI@2
displayName: Pack
inputs:
command: custom
custom: pack
arguments: >
MCP2221IO.sln
--output $(Build.ArtifactStagingDirectory)
-p:PackageVersion=$(PackageVersion)
-p:Configuration=$(BuildConfiguration)
-p:Version=$(PackageVersion)
-p:AssemblyVersion=$(Build.BuildNumber)
- task: GitHubRelease@1
displayName: "Publish Relase To GitHub"
inputs:
gitHubConnection: 'GitHub PAT'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(Build.BuildNumber)'
title: 'v$(Build.BuildNumber) - $(BuildConfiguration) - $(Build.SourceBranchName)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'