@@ -2,18 +2,25 @@ variables:
2
2
BuildVersion : $[counter('release-counter', 1)]
3
3
IsRunningOnCI : true
4
4
DotNet.Cli.Telemetry.OptOut : true
5
- provisioningVS : true
6
5
provisionator.path : ' $(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
7
6
provisionator.vs : ' $(System.DefaultWorkingDirectory)/eng/provisioning/vs.csx'
8
7
provisionator.extraArguments : ' --v'
9
- signingCondition : and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') ))))
8
+ signingCondition : or(eq(variables['Sign'], 'true'),
9
+ or(eq(variables['Build.SourceBranch'], 'refs/heads/main'),
10
+ or(startsWith(variables['Build.SourceBranch'],'refs/tags/'), startsWith(variables['Build.SourceBranch'],'refs/heads/release/') )
11
+ )
12
+ )
10
13
11
14
parameters :
12
15
- name : BuildConfigurations
13
16
type : object
14
17
default :
15
- - Debug
16
- - Release
18
+ - name : Debug
19
+ poolName : $(windowsNet6VmPool)
20
+ vmImage : $(windowsNet6VmImage)
21
+ - name : Release
22
+ poolName : $(windowsNet6VmPool)
23
+ vmImage : $(windowsNet6VmPool)
17
24
18
25
trigger :
19
26
branches :
@@ -62,20 +69,21 @@ resources:
62
69
type : github
63
70
name : xamarin/yaml-templates
64
71
endpoint : xamarin
65
- ref : refs/heads/main # still defaults to master even though main is the main branch
72
+ ref : refs/heads/main
66
73
67
74
stages :
68
75
- stage : windows
69
76
displayName : Build Windows
70
77
jobs :
71
78
- ${{ each BuildConfiguration in parameters.BuildConfigurations }} :
72
- - job : win_hosted_${{ BuildConfiguration }}
79
+ - job : win_hosted_${{ BuildConfiguration.name }}
73
80
workspace :
74
81
clean : all
75
- displayName : Build Windows Phase (${{ BuildConfiguration }})
82
+ displayName : Build Windows Phase (${{ BuildConfiguration.name }})
76
83
timeoutInMinutes : 60
77
84
pool :
78
- vmImage : windows-2022
85
+ name : ${{ BuildConfiguration.poolName }}
86
+ vmImage : ${{ BuildConfiguration.vmImage }}
79
87
steps :
80
88
81
89
- template : /eng/pipelines/common/provision.yml
@@ -97,14 +105,6 @@ stages:
97
105
- pwsh : dotnet tool restore
98
106
displayName : install dotnet tools
99
107
100
-
101
- - pwsh : |
102
- & dotnet vs where --prop=InstallationPath
103
- displayName: list vs installs
104
-
105
- - pwsh : echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
106
- displayName : Select JDK 11
107
-
108
108
- pwsh : |
109
109
[xml] $fileXml = Get-Content "eng\Versions.props"
110
110
$DotNetVersion = $fileXml.SelectSingleNode("Project/PropertyGroup/MicrosoftDotnetSdkInternalPackageVersion").InnerText
@@ -122,11 +122,6 @@ stages:
122
122
displayName: install .NET
123
123
errorActionPreference: stop
124
124
125
- # - pwsh: |
126
- # rm $env:DOTNET_ROOT\metadata\workloads\6.0.200\installertype\msi
127
- # displayName: don't use msi .net
128
- # errorActionPreference: stop
129
-
130
125
- pwsh : |
131
126
dotnet build ./build/DotNet/DotNet.csproj -p:DotNetDirectory="$env:DOTNET_ROOT" -p:InstallDotNet=false
132
127
displayName: install dotnet workloads
@@ -143,10 +138,7 @@ stages:
143
138
.\winsdksetup.exe /norestart /quiet | Out-Null
144
139
dir "C:\Program Files (x86)\Windows Kits\10\References\"
145
140
displayName: install Windows 10 SDK, version 1903 (10.0.18362.1)
146
-
147
- - pwsh : |
148
- & 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe' /r /m ./build/Build.Microsoft.Maui.Graphics.Windows.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}.binlog
149
- displayName: build classic solutions
141
+ condition: eq(variables['provisioningWindowsSdk'], 'true')
150
142
151
143
- pwsh : |
152
144
# $VS_ROOT = (& dotnet vs where --prop=InstallationPath)[0]
@@ -159,16 +151,20 @@ stages:
159
151
errorActionPreference: stop
160
152
161
153
- pwsh : |
162
- & $env:MSBUILD_EXE /r /m ./Microsoft.Maui.Graphics-net6.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}-net6.binlog
154
+ & $env:MSBUILD_EXE /r /m ./build/Build.Microsoft.Maui.Graphics.Windows.sln /p:Configuration=${{ BuildConfiguration.name }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}.binlog
155
+ displayName: build classic solutions~
156
+
157
+ - pwsh : |
158
+ & $env:MSBUILD_EXE /r /m ./Microsoft.Maui.Graphics-net6.sln /p:Configuration=${{ BuildConfiguration.name }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}-net6.binlog
163
159
displayName: build net6 solutions
164
160
165
161
- task : NuGetCommand@2
166
162
displayName : ' Pack nupkg'
167
163
inputs :
168
164
command : ' pack'
169
165
packagesToPack : ' **\Microsoft.Maui.*.nuspec'
170
- packDestination : ' $(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}'
171
- configuration : ${{ BuildConfiguration }}
166
+ packDestination : ' $(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}'
167
+ configuration : ${{ BuildConfiguration.name }}
172
168
basePath : ' $(System.DefaultWorkingDirectory)'
173
169
versioningScheme : ' byEnvVar'
174
170
versionEnvVar : ' BUILD_BUILDNUMBER'
@@ -178,7 +174,7 @@ stages:
178
174
inputs :
179
175
Contents : |
180
176
**/SignList.xml
181
- TargetFolder : ' $(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}'
177
+ TargetFolder : ' $(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}'
182
178
flattenFolders : true
183
179
184
180
- task : PublishBuildArtifacts@1
@@ -203,19 +199,29 @@ stages:
203
199
signedArtifactName : nuget
204
200
signedArtifactPath : signed
205
201
displayName : Sign Phase
206
- condition : ${{ variables['signingCondition'] }}
202
+ condition : and(succeeded(), ${{ variables['signingCondition'] }} )
207
203
208
204
- stage : sbom
209
205
displayName : ' Software Bill of Materials'
210
- ${{ if not(variables['signingCondition']) }} :
211
- dependsOn : [ 'windows' ]
212
- ${{ if variables['signingCondition'] }} :
213
- dependsOn : [ 'nuget_signing' ]
206
+ dependsOn : [ 'windows', 'nuget_signing' ]
207
+ condition : succeeded('windows')
214
208
jobs :
215
209
- template : compliance/sbom/job.v1.yml@xamarin-templates
216
210
parameters :
211
+ jobName : SBOM_PR
212
+ jobDisplayName : ' Software Bill of Materials (PR)'
213
+ artifactNames : ['nuget']
214
+ artifactMap : ['nuget/Release']
215
+ packageName : ' Microsoft Maui Graphics'
216
+ packageFilter : ' *.nupkg'
217
+ condition : not(${{ variables['signingCondition'] }}) # Executed when signing is not enabled such as for pull request builds (PRs)
218
+
219
+ - template : compliance/sbom/job.v1.yml@xamarin-templates
220
+ parameters :
221
+ jobName : SBOM_CI
222
+ jobDisplayName : ' Software Bill of Materials (CI)'
217
223
artifactNames : ['nuget']
218
- ${{ if variables['signingCondition'] }} :
219
- artifactMap : ['nuget/signed']
224
+ artifactMap : ['nuget/signed']
220
225
packageName : ' Microsoft Maui Graphics'
221
226
packageFilter : ' *.nupkg'
227
+ condition : and(succeeded(), ${{ variables['signingCondition'] }} ) # Executed when signing is enabled such as for continuous integration builds (CIs)
0 commit comments