Repository navigation
Expand file tree
/
Copy pathazure-pipelines.yaml
More file actions
660 lines (585 loc) · 30.2 KB
/
Copy pathazure-pipelines.yaml
File metadata and controls
660 lines (585 loc) · 30.2 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
# .NET for Android Pipeline
name: $(Build.SourceBranchName)-$(Build.SourceVersion)-$(Rev:r)
trigger:
- main
- d16-*
- d17-*
- release/*
# External sources, scripts, tests, and yaml template files.
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
- repository: yaml-templates
type: github
name: xamarin/yaml-templates
ref: refs/heads/main
endpoint: xamarin
- repository: sdk-insertions
type: github
name: xamarin/sdk-insertions
ref: refs/heads/main
endpoint: xamarin
- repository: monodroid
type: github
name: xamarin/monodroid
ref: refs/heads/main
endpoint: xamarin
- repository: maui
type: github
name: dotnet/maui
ref: refs/heads/net9.0
endpoint: xamarin
parameters:
- name: pushXAPackagesToMaestro
default: true
- name: macTestAgentsUseCleanImages # Test agents we do not need to clean up when finished because they are not reused
default: true
- name: Skip1ESComplianceTasks
default: false
# Global variables
variables:
- template: /build-tools/automation/yaml-templates/variables.yaml@self
- template: templates/common/vs-release-vars.yml@sdk-insertions
- ${{ if eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}:
- group: AzureDevOps-Artifact-Feeds-Pats
- group: DotNet-MSRC-Storage
- name: DotNetFeedCredential
value: dotnet8-internal-dnceng-internal-feed
- ${{ if ne(variables['Build.DefinitionName'], 'Xamarin.Android-Private') }}:
- name: DotNetFeedCredential
value: dnceng-dotnet9
- name: MicroBuildSignType
${{ if and(or(eq(variables['Build.DefinitionName'], 'Xamarin.Android'), eq(variables['Build.DefinitionName'], 'Xamarin.Android-Private')), ne(variables['Build.Reason'], 'PullRequest')) }}:
value: Real
${{ else }}:
value: Test
extends:
${{ if eq(variables['MicroBuildSignType'], 'Real') }}:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
${{ else }}:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
sdl:
${{ if eq('${{ parameters.Skip1ESComplianceTasks }}', 'true') }}:
enableAllTools: false
binskim:
scanOutputDirectoryOnly: true
codeql:
${{ if ne(variables['Build.SourceBranch'], 'refs/heads/main') }}:
compiled:
enabled: false
justificationForDisabling: CodeQL disabled for non-main branch builds
policheck:
enabled: false
justification: Built in task does not support multi-language scanning
spotBugs:
enabled: false
justification: 'Failing with "Could not successfully find the java tool launcher"'
sourceAnalysisPool:
name: AzurePipelines-EO
image: $(WindowsPoolImage1ESPT)
os: windows
sourceRepositoriesToScan:
include:
- ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}:
- repository: monodroid
exclude:
- repository: yaml-templates
- repository: maui
suppression:
suppressionFile: $(Build.SourcesDirectory)\.gdn\.gdnsuppress
settings:
skipBuildTagsForGitHubPullRequests: true
stages:
- template: /build-tools/automation/yaml-templates/build-macos.yaml@self
- template: /build-tools/automation/yaml-templates/build-windows.yaml@self
- template: /build-tools/automation/yaml-templates/build-linux.yaml@self
- stage: smoke_tests
displayName: Package Tests
dependsOn: mac_build
jobs:
# Check - "Xamarin.Android (Package Tests macOS > Tests > APKs .NET)"
- job: mac_apk_tests_net
displayName: macOS > Tests > APKs .NET
pool:
name: Azure Pipelines
vmImage: $(HostedMacImage)
os: macOS
timeoutInMinutes: 180
workspace:
clean: all
steps:
- template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self
parameters:
xaprepareScenario: EmulatorTestDependencies
- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(TestAssembliesArtifactName)
downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)
# Set up dependencies to run tests in both debug and release configurations
- task: DotNetCoreCLI@2
displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj
inputs:
projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj
arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
parameters:
project: Xamarin.Android.sln
arguments: >-
-t:PrepareJavaInterop -c Debug --no-restore
-p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet
displayName: prepare java.interop Debug
continueOnError: false
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
parameters:
project: Xamarin.Android.sln
arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore
displayName: prepare java.interop $(XA.Build.Configuration)
continueOnError: false
- template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-$(XA.Build.Configuration)
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration).xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration)
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
parameters:
buildConfiguration: $(XA.Build.Configuration)
configuration: Debug
testName: Mono.Android.NET_Tests-Debug
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-Debug.xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-Debug
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-NoAab
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAab.xml
extraBuildArgs: -p:TestsFlavor=NoAab -p:AndroidPackageFormat=apk
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-NoAab
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-Interpreter
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)Interpreter.xml
extraBuildArgs: -p:TestsFlavor=Interpreter -p:UseInterpreter=True
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-Interpreter
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-NoAot
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAot.xml
extraBuildArgs: -p:TestsFlavor=NoAot -p:RunAOTCompilation=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-NoAot
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
parameters:
configuration: $(XA.Build.Configuration)
testName: Mono.Android.NET_Tests-AotLlvm
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)AotLlvm.xml
extraBuildArgs: -p:TestsFlavor=AotLlvm -p:EnableLLVM=true -p:AndroidEnableProfiledAot=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-AotLlvm
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
parameters:
configuration: $(XA.Build.Configuration)
testName: Xamarin.Android.JcwGen_Tests
project: tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj
testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(XA.Build.Configuration).xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-Default
- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self
parameters:
testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll
- task: ShellScript@2
displayName: Test dotnet-local.sh
inputs:
scriptPath: dotnet-local.sh
args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj
- ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}:
- template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self
parameters:
command: stop
- template: /build-tools/automation/yaml-templates/upload-results.yaml@self
parameters:
artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS
- template: /build-tools/automation/yaml-templates/upload-results.yaml@self
parameters:
artifactName: Test Results - APKs .NET Debug - macOS
configuration: Debug
- template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self
- stage: linux_tests
displayName: Linux Tests
dependsOn:
- mac_build
- linux_build
jobs:
# Check - "Xamarin.Android (Linux Tests Linux > Tests > MSBuild)"
- job: linux_tests_smoke
displayName: Linux > Tests > MSBuild
pool:
name: MAUI-1ESPT
image: $(LinuxPoolImage1ESPT)
os: linux
timeoutInMinutes: 180
workspace:
clean: all
steps:
- template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self
- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(TestAssembliesArtifactName)
downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)
- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = BuildTest"
- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = PackagingTest"
- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = XASdkTests & Name != XamarinLegacySdk"
- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = AndroidDependenciesTests"
- task: ShellScript@2
displayName: Test dotnet-local.sh
inputs:
scriptPath: dotnet-local.sh
args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj
- template: /build-tools/automation/yaml-templates/upload-results.yaml@self
parameters:
configuration: $(XA.Build.Configuration)
artifactName: Test Results - MSBuild - Linux
- template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self
- template: /build-tools/automation/yaml-templates/stage-msbuild-tests.yaml@self
- template: /build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml@self
parameters:
usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }}
- stage: maui_tests
displayName: MAUI Tests
dependsOn: mac_build
condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(variables['RunMAUITestJob'], 'true'))
jobs:
# Check - "Xamarin.Android (MAUI Tests MAUI Integration)"
- job: maui_tests_integration
displayName: MAUI Integration
pool:
name: MAUI-1ESPT
image: $(WindowsPoolImage1ESPT)
os: windows
timeoutInMinutes: 180
workspace:
clean: all
variables:
BuildVersion: $(Build.BuildId)
steps:
- checkout: maui
clean: true
submodules: recursive
path: s/maui
persistCredentials: true
- template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self
parameters:
xaSourcePath: $(Build.SourcesDirectory)/android
androidSdkPlatforms: $(DefaultTestSdkPlatforms)
dotnetVersion: 9.0
dotnetQuality: preview
- task: NuGetAuthenticate@1
displayName: authenticate with azure artifacts
inputs:
forceReinstallCredentialProvider: true
- script: |
echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64%
echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_17_X64%
displayName: set JI_JAVA_HOME, JAVA_HOME to $(JAVA_HOME_17_X64)
- script: echo "##vso[task.prependpath]C:\Windows\System32\WindowsPowerShell\v1.0\"
displayName: add powershell to path
- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(NuGetArtifactName)
downloadPath: $(Build.StagingDirectory)/android-packs
- pwsh: |
$searchPath = Join-Path $(Build.StagingDirectory) android-packs
$wlmanPack = Get-ChildItem $searchPath -Filter *Android*Manifest*.nupkg | Select-Object -First 1
$dest = Join-Path $searchPath "tmp-wlman" "$($wlmanPack.BaseName)"
Expand-Archive -LiteralPath $wlmanPack -DestinationPath $dest
$wlmanJsonPath = Join-Path $dest "data" "WorkloadManifest.json"
$json = Get-Content $wlmanJsonPath | ConvertFrom-Json -AsHashtable
Write-Host "Setting variable ANDROID_PACK_VERSION = $($json["version"])"
Write-Host "##vso[task.setvariable variable=ANDROID_PACK_VERSION;]$($json["version"])"
displayName: Set ANDROID_PACK_VERSION
- pwsh: >-
$(Build.SourcesDirectory)/maui/eng/scripts/update-version-props.ps1
-xmlFileName "$(Build.SourcesDirectory)/maui/eng/Versions.props"
-androidVersion $(ANDROID_PACK_VERSION)
displayName: Update MAUI's Android dependency
- task: DotNetCoreCLI@2
displayName: Update Android SDK band in Workloads.csproj
inputs:
projects: $(Build.SourcesDirectory)/android/Xamarin.Android.sln
arguments: -t:UpdateMauiWorkloadsProj -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/update-maui-workloadsproj.binlog
- pwsh: ./build.ps1 --target=dotnet --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic
displayName: Install .NET
retryCountOnTaskFailure: 3
workingDirectory: $(Build.SourcesDirectory)/maui
- pwsh: ./build.ps1 --target=dotnet-pack --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic
displayName: Pack .NET Maui
workingDirectory: $(Build.SourcesDirectory)/maui
- task: DotNetCoreCLI@2
displayName: Install MAUI workload packs
retryCountOnTaskFailure: 3
inputs:
projects: $(Build.SourcesDirectory)/android/Xamarin.Android.sln
arguments: -t:InstallMaui -p:MauiUseLocalPacks=true -p:MauiWorkloadToInstall=maui -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/install-maui.binlog
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
parameters:
command: new
arguments: maui -o $(Build.StagingDirectory)/MauiTestProj
xaSourcePath: $(Build.SourcesDirectory)/android
displayName: Create MAUI template
continueOnError: false
- powershell: |
$project = '$(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj'
[xml] $xml = Get-Content $project
$node = $xml.SelectSingleNode('/Project/PropertyGroup/TargetFrameworks')
$node.InnerText = '$(DotNetTargetFramework)-android'
$xml.Save($project)
displayName: set TargetFrameworks to Android-only
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
parameters:
project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj
arguments: >-
-f $(DotNetTargetFramework)-android -c Debug
--configfile $(Build.SourcesDirectory)/maui/NuGet.config
-bl:$(Build.StagingDirectory)/logs/MauiTestProj-Debug.binlog
xaSourcePath: $(Build.SourcesDirectory)/android
displayName: Build MAUI template - Debug
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
parameters:
project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj
arguments: >-
-f $(DotNetTargetFramework)-android -c Release
--configfile $(Build.SourcesDirectory)/maui/NuGet.config
-bl:$(Build.StagingDirectory)/logs/MauiTestProj-Release.binlog
xaSourcePath: $(Build.SourcesDirectory)/android
displayName: Build MAUI template - Release
- task: CopyFiles@2
displayName: copy build logs
condition: always()
inputs:
Contents: |
$(Build.SourcesDirectory)/maui/artifacts/logs/**
TargetFolder: $(Build.StagingDirectory)/logs
flattenFolders: true
- template: /build-tools/automation/yaml-templates/publish-artifact.yaml@self
parameters:
displayName: upload build and test results
artifactName: Test Results - MAUI Integration
targetPath: $(Build.StagingDirectory)/logs
condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true'))
- template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self
- stage: dotnet_prepare_release
displayName: Prepare .NET Release
dependsOn:
- mac_build
- linux_build
condition: and(eq(dependencies.mac_build.result, 'Succeeded'), eq(dependencies.linux_build.result, 'Succeeded'), eq(variables['MicroBuildSignType'], 'Real'))
jobs:
# Check - "Xamarin.Android (Prepare .NET Release Sign Archives)"
- template: sign-artifacts/jobs/v3.yml@yaml-templates
parameters:
name: sign_net_mac_win
poolName: $(VSEngMicroBuildPool)
artifactName: $(NuGetArtifactName)
signType: $(MicroBuildSignType)
signedArtifactName: nuget-signed
usePipelineArtifactTasks: true
use1ESTemplate: true
uploadPrefix: sign-mac-win
handleUnmappedFiles: fail
timeoutInMinutes: 240
# Check - "Xamarin.Android (Prepare .NET Release Sign Linux Archive)"
- template: sign-artifacts/jobs/v3.yml@yaml-templates
parameters:
name: sign_net_linux
displayName: Sign Linux Archive
poolName: $(VSEngMicroBuildPool)
artifactName: $(LinuxNuGetArtifactName)
signType: $(MicroBuildSignType)
signedArtifactName: nuget-linux-signed
usePipelineArtifactTasks: true
use1ESTemplate: true
uploadPrefix: sign-linux
handleUnmappedFiles: fail
timeoutInMinutes: 120
# Check - "Xamarin.Android (Prepare .NET Release Convert NuGet to MSI)"
- template: nuget-msi-convert/job/v3.yml@yaml-templates
parameters:
yamlResourceName: yaml-templates
dependsOn: sign_net_mac_win
artifactName: nuget-signed
artifactPatterns: |
!*Darwin*
propsArtifactName: $(NuGetArtifactName)
signType: $(MicroBuildSignType)
use1ESTemplate: true
postConvertSteps:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(NuGetArtifactName)
downloadPath: $(Build.StagingDirectory)\sign-verify
patterns: |
**/SignVerifyIgnore.txt
- task: MicroBuildCodesignVerify@3
displayName: verify signed msi content
inputs:
TargetFolders: |
$(Build.ArtifactStagingDirectory)\bin\manifests
$(Build.ArtifactStagingDirectory)\bin\manifests-multitarget
ExcludeSNVerify: true
ApprovalListPathForCerts: $(Build.StagingDirectory)\sign-verify\SignVerifyIgnore.txt
# Check - "Xamarin.Android (Prepare .NET Release Push Internal)"
- job: push_signed_nugets
displayName: Push Internal
dependsOn:
- nuget_convert
- sign_net_linux
condition: and(eq(dependencies.nuget_convert.result, 'Succeeded'), eq(dependencies.sign_net_linux.result, 'Succeeded'))
timeoutInMinutes: 60
pool:
name: AzurePipelines-EO
image: $(WindowsPoolImage1ESPT)
os: windows
workspace:
clean: all
variables:
- ${{ if eq(variables['MicroBuildSignType'], 'Real') }}:
- group: Publish-Build-Assets
steps:
- checkout: self
clean: true
submodules: recursive
- task: DownloadPipelineArtifact@2
inputs:
artifactName: nuget-signed
downloadPath: $(Build.StagingDirectory)\nuget-signed
- task: DownloadPipelineArtifact@2
inputs:
artifactName: nuget-linux-signed
downloadPath: $(Build.StagingDirectory)\nuget-signed
- task: DownloadPipelineArtifact@2
inputs:
artifactName: vs-msi-nugets
downloadPath: $(Build.StagingDirectory)\nuget-signed
- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(WindowsToolchainPdbArtifactName)
downloadPath: $(Build.StagingDirectory)\nuget-signed
- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
parameters:
githubToken: $(GitHub.Token)
githubContext: $(NupkgCommitStatusName)
blobName: $(NupkgCommitStatusName)
packagePrefix: xamarin-android
artifactsPath: $(Build.StagingDirectory)\nuget-signed
yamlResourceName: yaml-templates
- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
parameters:
githubToken: $(GitHub.Token)
githubContext: $(VSDropCommitStatusName)
blobName: $(VSDropCommitStatusName)
packagePrefix: xamarin-android
artifactsPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
yamlResourceName: yaml-templates
downloadSteps:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: vsdrop-signed
downloadPath: $(Build.StagingDirectory)\$(VSDropCommitStatusName)
- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
parameters:
githubToken: $(GitHub.Token)
githubContext: $(MultiTargetVSDropCommitStatusName)
blobName: $(MultiTargetVSDropCommitStatusName)
packagePrefix: xamarin-android
artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
yamlResourceName: yaml-templates
downloadSteps:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: vsdrop-multitarget-signed
downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName)
- task: DotNetCoreCLI@2
displayName: build Xamarin.Android.Tools.BootstrapTasks.sln
inputs:
projects: $(System.DefaultWorkingDirectory)\Xamarin.Android.BootstrapTasks.sln
arguments: -c $(XA.Build.Configuration) -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\bootstrap.binlog
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
- task: DotNetCoreCLI@2
displayName: generate and publish BAR manifest
inputs:
projects: $(System.DefaultWorkingDirectory)\build-tools\create-packs\Microsoft.Android.Sdk.proj
arguments: >-
-t:PushManifestToBuildAssetRegistry
-p:BuildAssetRegistryToken=$(MaestroAccessToken)
-p:OutputPath=$(Build.StagingDirectory)\nuget-signed\
-c $(XA.Build.Configuration) -bl:$(System.DefaultWorkingDirectory)\bin\Build$(XA.Build.Configuration)\push-bar-manifest.binlog
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
- powershell: |
$versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16'
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
$arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json'
& dotnet tool update microsoft.dotnet.darc --version "$darcVersion" --add-source "$arcadeServicesSource" --tool-path $(Agent.ToolsDirectory)\darc -v n
& $(Agent.ToolsDirectory)\darc\darc add-build-to-channel --default-channels --id $(BARBuildId) --publishing-infra-version 3 --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
displayName: add build to default darc channel
condition: and(succeeded(), eq('${{ parameters.pushXAPackagesToMaestro }}', 'true'))
- template: build-tools\automation\yaml-templates\upload-results.yaml@self
parameters:
xaSourcePath: $(System.DefaultWorkingDirectory)
artifactName: Prepare Release - Push Internal
includeBuildResults: true
# Check - "Xamarin.Android (PoliCheck PoliCheck $(Language))"
- template: security/policheck/v3.yml@yaml-templates
parameters:
windowsImageOverride: $(WindowsPoolImage1ESPT)
stageDependsOn: []
tsaConfigFile: $(Build.SourcesDirectory)\.gdn\tsaoptions-v2.json
policheckLocScanEnabled: true
policheckExclusionFilesFolder: $(Build.SourcesDirectory)\.gdn\policheck
policheckGdnSuppressionFilesFolder: $(Build.SourcesDirectory)\.gdn\policheck
policheckChsScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hans
policheckChtScanFolder: $(Build.SourcesDirectory)\Localize\loc\zh-Hant
policheckCsyScanFolder: $(Build.SourcesDirectory)\Localize\loc\cs
policheckDeuScanFolder: $(Build.SourcesDirectory)\Localize\loc\de
policheckEsnScanFolder: $(Build.SourcesDirectory)\Localize\loc\es
policheckFraScanFolder: $(Build.SourcesDirectory)\Localize\loc\fr
policheckItaScanFolder: $(Build.SourcesDirectory)\Localize\loc\it
policheckJpnScanFolder: $(Build.SourcesDirectory)\Localize\loc\ja
policheckKorScanFolder: $(Build.SourcesDirectory)\Localize\loc\ko
policheckPlkScanFolder: $(Build.SourcesDirectory)\Localize\loc\pl
policheckPtbScanFolder: $(Build.SourcesDirectory)\Localize\loc\pt-BR
policheckRusScanFolder: $(Build.SourcesDirectory)\Localize\loc\ru
policheckTrkScanFolder: $(Build.SourcesDirectory)\Localize\loc\tr