-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
108 lines (97 loc) · 2.68 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
trigger:
- master
variables:
buildConfiguration: 'Release'
releaseBranch: 'refs/heads/master'
nuGetArtifactName: 'NuGet Packages'
CI: true
jobs:
- job: Build
strategy:
matrix:
Windows:
imageName: 'windows-2019'
Linux:
imageName: 'ubuntu-latest'
macOS:
imageName: 'macOS-latest'
pool:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
displayName: Install .NET Core 2.0 SDK
inputs:
version: '2.0.x'
- task: UseDotNet@2
displayName: Install .NET Core 2.1 SDK
inputs:
version: '2.1.x'
- task: UseDotNet@2
displayName: Install .NET Core 2.2 SDK
inputs:
version: '2.2.x'
- task: UseDotNet@2
displayName: Install .NET Core 3.0 SDK
inputs:
version: '3.0.x'
- task: UseDotNet@2
displayName: Install .NET Core 3.1 SDK
inputs:
version: '3.1.x'
- task: UseDotNet@2
displayName: Install .NET 5.0 SDK
inputs:
version: '5.0.x'
- task: PowerShell@2
displayName: Build / Test / Pack
inputs:
filePath: 'build/build.ps1'
arguments: '--configuration $(buildConfiguration) --ArtifactsDirectory $(Build.ArtifactStagingDirectory) --no-logo'
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/*.trx'
condition: always()
# Only publish Windows artifacts since only Windows supports a full build.
# The Publish job will not run if any OS fails building.
- task: PublishBuildArtifacts@1
displayName: Publish NuGet Package Artifacts (Windows)
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(nuGetArtifactName)'
condition: |
and
(
succeeded(),
eq(variables['build.sourceBranch'], variables['releaseBranch']),
eq(variables['system.pullrequest.isfork'], false),
eq(variables['Agent.OS'], 'Windows_NT')
)
- job: Publish
dependsOn: Build
condition: |
and
(
succeeded(),
eq(variables['build.sourceBranch'], variables['releaseBranch']),
eq(variables['system.pullrequest.isfork'], false)
)
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadBuildArtifacts@0
displayName: Download NuGet Package Artifacts
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '$(nuGetArtifactName)'
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
displayName: Push to NuGet
inputs:
command: 'push'
packagesToPush: '$(System.ArtifactsDirectory)/**/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet'
allowPackageConflicts: true