This repository has been archived by the owner on May 30, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
96 lines (87 loc) · 2.59 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
trigger:
branches:
include:
- master
paths:
include:
- '*'
exclude:
- '*.md'
name: MADE MSTest Extension Library - $(major).$(minor).$(Year:yy)$(DayOfYear).$(rev:r)$(prerelease) # build numbering format
stages:
- stage: Build
jobs:
- job:
pool:
vmImage: 'windows-latest'
displayName: Build
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
inputs:
versionSpec: '$(nugetVersion)'
- task: NuGetCommand@2
displayName: 'Restore NuGet packages'
inputs:
restoreSolution: '$(solution)'
- task: richardfennellBM.BM-VSTS-Versioning-Task.Version-DotNetCoreAssemblies-Task.VersionDotNetCoreAssemblies@2
displayName: 'Version .NET Core projects'
inputs:
Path: '$(Build.SourcesDirectory)'
VersionNumber: '$(Build.BuildNumber)'
Injectversion: False
VersionRegex: '\d+.\d+.\d+.\d+(\-[a-z]+)?'
FilenamePattern: '.csproj'
SDKNames: 'Microsoft.NET.Sdk,MSBuild.Sdk.Extras'
OutputVersion: 'OutputedVersion'
# Build solution
- task: VSBuild@1
displayName: 'Build SDK'
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
clean: true
maximumCpuCount: true
# Run unit tests
- task: DotNetCoreCLI@2
displayName: 'DotNetCore Test'
inputs:
command: 'test'
projects: '**/*.UnitTests.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage" --no-restore'
# Publish artifacts
- task: CopyFiles@2
displayName: 'Copy NuGet packages for publish'
inputs:
Contents: '**\*.nupkg'
TargetFolder: '$(build.artifactstagingdirectory)\packages'
CleanTargetFolder: true
- publish: $(Build.ArtifactStagingDirectory)
artifact: Drop
- stage: Release
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- job:
pool:
vmImage: 'windows-latest'
workspace:
clean: all
displayName: Release
steps:
- download: current
- task: NuGetToolInstaller@1
displayName: 'Get NuGet Version'
inputs:
versionSpec: '$(nugetVersion)'
- task: NuGetCommand@2
displayName: 'Push to NuGet'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'NuGet - MADE Apps'