forked from microsoft/WPF-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
168 lines (149 loc) · 5.27 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
# .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
variables:
- name: solution
value: 'WPFSamples.sln'
- name: msbuildonlysolution
value: 'WPFSamples.msbuild.sln'
- name: LangVersion
value: latest
trigger:
- main
- release/*
pool:
vmImage: 'windows-latest'
stages:
- stage: Build
displayName: Build
jobs:
- job: Windows
pool:
vmImage: 'windows-latest'
variables:
- name: _Configuration
value: Debug
- name: _Platform
value: x86
- name: _ToolPlatform
value: x86
- name: _TargetFramework
value: 'net6.0-windows'
strategy:
matrix:
Debug-AnyCPU-net6.0-windows:
_Configuration: Debug
_Platform: 'Any CPU'
_TargetFramework: 'net6.0-windows'
_ToolPlatform: x86
Debug-x64-net6.0-windows:
_Configuration: Debug
_Platform: 'x64'
_TargetFramework: 'net6.0-windows'
_ToolPlatform: x64
Debug-x86-net6.0-windows:
_Configuration: Debug
_Platform: 'x86'
_TargetFramework: 'net6.0-windows'
_ToolPlatform: x86
Release-AnyCPU-net6.0-windows:
_Configuration: Release
_Platform: 'Any CPU'
_TargetFramework: 'net6.0-windows'
_ToolPlatform: x86
Release-x64-net6.0-windows:
_Configuration: Release
_Platform: 'x64'
_TargetFramework: 'net6.0-windows'
_ToolPlatform: x64
Release-x86-net6.0-windows:
_Configuration: Release
_Platform: 'x86'
_TargetFramework: 'net6.0-windows'
_ToolPlatform: x86
steps:
- task: NuGetToolInstaller@1
displayName: 'Download and Cache Nuget tool'
- powershell: ./eng/EnsureGlobalJsonSdk.ps1 -g global.json -i "$(Agent.ToolsDirectory)/dotnet" -a $(_ToolPlatform) -f $(_TargetFramework) -Verbose
displayName: Install .NET Core
- powershell: |
Write-Host "Path Environment Variable:"
Write-Host $env:PATH
Write-Host
Write-Host "List of Installed .NET Core SDK's"
dotnet --list-sdks
displayName: List .NET SDK's
- task: NuGetCommand@2
displayName: 'Restore .NET Core Samples Using NuGet'
inputs:
restoreSolution: '$(solution)'
- task: NuGetCommand@2
displayName: 'Restore MSBuild-only .NET Core Samples Using NuGet'
inputs:
restoreSolution: '$(msbuildonlysolution)'
- task: VSBuild@1
continueOnError: true
displayName: 'Build .NET Core Samples using VSBuild'
inputs:
vsVersion: latest
solution: '$(solution)'
platform: '$(_Platform)'
msbuildArchitecture: '$(_ToolPlatform)'
configuration: '$(_Configuration)'
msbuildArgs: /m /bl:"$(Build.ArtifactStagingDirectory)\vsbuild\vsbuild.$(_Configuration).$(_Platform).$(_TargetFramework).binlog" /p:LangVersion=$(LangVersion)
- task: VSBuild@1
continueOnError: true
displayName: 'Build MSBuild-only.NET Core Samples using VSBuild'
inputs:
vsVersion: latest
solution: '$(msbuildonlysolution)'
platform: '$(_Platform)'
msbuildArchitecture: '$(_ToolPlatform)'
configuration: '$(_Configuration)'
msbuildArgs: /m /bl:"$(Build.ArtifactStagingDirectory)\vsbuild\msbuild.vsbuild.$(_Configuration).$(_Platform).$(_TargetFramework).binlog" /p:LangVersion=$(LangVersion)
- task: PublishBuildArtifacts@1
continueOnError: true
displayName: 'Publish .NET Core VSBuild Build Logs'
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\vsbuild
ArtifactName: 'Build Logs'
publishLocation: 'Container'
- task: PowerShell@2
displayName: 'Clean Files From Previous Build'
inputs:
targetType: 'inline'
script: |
# Write your PowerShell commands here.
git clean -xdf
- task: DotNetCoreCLI@2
continueOnError: true
displayName: 'Restore .NET Core Samples using dotnet.exe'
inputs:
command: 'restore'
configuration: $(_Configuration)
projects: '$(solution)'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
- task: DotNetCoreCLI@2
continueOnError: true
displayName: 'Build .NET Core Samples using dotnet.exe'
inputs:
command: 'build'
projects: '$(solution)'
configuration: $(_Configuration)
arguments: '/bl:"$(Build.ArtifactStagingDirectory)\netcore\dotnet.$(_Configuration).$(_Platform).$(_TargetFramework).binlog" /p:Platform="$(_Platform)" /p:LangVersion=$(LangVersion)'
- task: PublishBuildArtifacts@1
displayName: 'Publish .NET Core Dotnet.exe Build Logs'
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)\netcore
ArtifactName: 'Build Logs'
publishLocation: 'Container'
- task: PowerShell@2
displayName: 'Clean Files From Previous Builds'
inputs:
targetType: 'inline'
script: |
# Write your PowerShell commands here.
git checkout global.json
git clean -xdf