|
1 | 1 | parameters:
|
2 | 2 | # Environment Parameters
|
3 |
| - name: 'build' # the name of the build job for dependency purposes |
4 |
| - timeoutInMinutes: 300 # the timeout in minutes |
5 |
| - mainBranchName: 'main' # the "main" branch that should be used - can be something other than "main" |
6 |
| - macosAgentPoolName: 'Azure Pipelines' # the name of the macOS VM pool |
7 |
| - # https://github.com/actions/runner-images |
8 |
| - macosImage: internal-macos12 # macOS VM image name, must be "internal" locked down image |
9 |
| - windowsAgentPoolName: android-win-2022 # the name of the Windows VM pool |
10 |
| - windowsImage: 'windows-latest' # the name of the Windows VM image |
| 3 | + name: # Job display name |
| 4 | + buildPool: # VM pool information |
| 5 | + classicInstallerUrl: # URL to retrieve the Classic XA installer |
11 | 6 |
|
| 7 | + # Build Parameters |
| 8 | + mainBranchName: 'main' # Name of Git "main" branch |
| 9 | + configuration: 'Release' # Build configuration: 'Debug', 'Release' |
| 10 | + verbosity: 'normal' # Build verbosity: 'minimal', 'normal', 'diagnostic' |
| 11 | + timeoutInMinutes: 300 # Max job runtime in minutes |
| 12 | + runAPIScan: false # Run APIScan analysis |
| 13 | + |
12 | 14 | # Tool Parameters
|
13 |
| - dotnetVersion: '7.0.405' # the version of .NET to use |
14 |
| - dotnetWorkloadRollbackFile: 'workloads.json' |
15 |
| - dotnetWorkloadSource: 'https://aka.ms/dotnet6/nuget/index.json' |
16 |
| - dotnetNuGetOrgSource: 'https://api.nuget.org/v3/index.json' |
17 |
| - classicXAPkg: https://aka.ms/xamarin-android-commercial-d17-4-macos |
18 |
| - classicXAVsix: https://aka.ms/xamarin-android-commercial-d17-4-windows |
19 |
| - skipUnitTests: false # do not run unit test step |
| 15 | + dotnetVersion: '7.0.406' # .NET version to install on agent |
| 16 | + dotnetWorkloadRollbackFile: 'workloads.json' # Rollback file specifying workload versions to install |
| 17 | + dotnetNuGetOrgSource: 'https://api.nuget.org/v3/index.json' # NuGet.org URL to find workloads |
| 18 | + dotnetWorkloadSource: 'https://aka.ms/dotnet6/nuget/index.json' # .NET engineering URL to find workloads |
| 19 | + skipUnitTests: false # Skip running unit tests |
20 | 20 |
|
21 |
| - tools: # a list of additional .NET global tools needed |
| 21 | + tools: # Additional .NET global tools to install |
22 | 22 | - 'xamarin.androidbinderator.tool': '0.5.7'
|
23 | 23 | - 'Cake.Tool': '4.0.0'
|
24 | 24 | - 'boots': '1.1.0.712-preview2'
|
25 | 25 | - 'private-api-tools': '1.0.2'
|
26 |
| - |
27 |
| - # Build Parameters |
28 |
| - verbosity: 'normal' # the build verbosity: 'minimal', 'normal', 'diagnostic' |
29 |
| - configuration: 'Release' # the build configuration: 'Debug', 'Release' |
30 | 26 |
|
31 | 27 | # Reporting/Analysis Parameters
|
32 |
| - areaPath: 'DevDiv\VS Client - Runtime SDKs\Android' # the areaPath to log any issues |
33 |
| - publishJob: '' # the job to use as the source of the 'nuget' artifact: '', 'windows', 'macos', 'linux' |
34 |
| - publishOutputSuffix: '' # the artifact suffix to use when publishing the output folder |
35 |
| - signListPath: 'SignList.xml' # the path to the SignList.xml to copy into the nuget artifact for signing |
36 |
| - artifactsPath: 'output' # the path to the NuGet packages that need to be signed, verified and published |
| 28 | + artifactsPath: 'output' # Path to the NuGet packages that need to be signed, verified and published |
| 29 | + signListPath: 'SignList.xml' # Path to 'SignList.xml' used for signing NuGet packages |
37 | 30 |
|
38 | 31 | jobs:
|
39 |
| - - job: ${{ parameters.name }} |
40 |
| - strategy: |
41 |
| - matrix: |
42 |
| - macos: |
43 |
| - poolName: ${{ parameters.macosAgentPoolName }} |
44 |
| - imageName: ${{ parameters.macosImage }} |
45 |
| - classicInstallerUrl: ${{ parameters.classicXAPkg }} |
46 |
| - runCodeQL: false |
47 |
| - windows: |
48 |
| - poolName: ${{ parameters.windowsAgentPoolName }} |
49 |
| - imageName: ${{ parameters.windowsImage }} |
50 |
| - classicInstallerUrl: ${{ parameters.classicXAVsix }} |
51 |
| - runCodeQL: true |
52 |
| - runAPIScan: true |
53 |
| - displayName: Build |
54 |
| - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} |
55 |
| - variables: |
56 |
| - Codeql.Enabled: $(runCodeQL) |
57 |
| - pool: |
58 |
| - name: $(poolName) |
59 |
| - vmImage: $(imageName) |
60 |
| - |
61 |
| - steps: |
62 |
| - - template: setup-environment.yml |
63 |
| - parameters: |
64 |
| - dotnetVersion: ${{ parameters.dotnetVersion }} |
65 |
| - dotnetWorkloadRollbackFile: ${{ parameters.dotnetWorkloadRollbackFile }} |
66 |
| - dotnetWorkloadSource: ${{ parameters.dotnetWorkloadSource }} |
67 |
| - dotnetNuGetOrgSource: ${{ parameters.dotnetNuGetOrgSource }} |
68 |
| - dotnetTools: ${{ parameters.tools }} |
69 |
| - classicInstallerUrl: $(classicInstallerUrl) |
| 32 | +- job: build_${{ parameters.name }} |
| 33 | + displayName: ${{ parameters.name }} |
| 34 | + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} |
| 35 | + pool: ${{ parameters.buildPool }} |
| 36 | + |
| 37 | + templateContext: |
| 38 | + sdl: |
| 39 | + spotBugs: |
| 40 | + enabled: false |
| 41 | + binskim: |
| 42 | + scanOutputDirectoryOnly: true |
| 43 | + outputs: |
| 44 | + - output: pipelineArtifact |
| 45 | + targetPath: ${{ parameters.artifactsPath }} |
| 46 | + artifactName: output-${{ parameters.name }} |
| 47 | + |
| 48 | + steps: |
| 49 | + - template: setup-environment.yml |
| 50 | + parameters: |
| 51 | + dotnetVersion: ${{ parameters.dotnetVersion }} |
| 52 | + dotnetWorkloadRollbackFile: ${{ parameters.dotnetWorkloadRollbackFile }} |
| 53 | + dotnetWorkloadSource: ${{ parameters.dotnetWorkloadSource }} |
| 54 | + dotnetNuGetOrgSource: ${{ parameters.dotnetNuGetOrgSource }} |
| 55 | + dotnetTools: ${{ parameters.tools }} |
| 56 | + classicInstallerUrl: ${{ parameters.classicInstallerUrl }} |
70 | 57 |
|
71 |
| - - template: build-and-test.yml |
72 |
| - parameters: |
73 |
| - artifactsPath: ${{ parameters.artifactsPath }} |
74 |
| - verbosity: ${{ parameters.verbosity }} |
75 |
| - configuration: ${{ parameters.configuration }} |
76 |
| - skipUnitTests: ${{ parameters.skipUnitTests }} |
| 58 | + - template: build-and-test.yml |
| 59 | + parameters: |
| 60 | + artifactsPath: ${{ parameters.artifactsPath }} |
| 61 | + verbosity: ${{ parameters.verbosity }} |
| 62 | + configuration: ${{ parameters.configuration }} |
| 63 | + skipUnitTests: ${{ parameters.skipUnitTests }} |
77 | 64 |
|
| 65 | + - ${{ if eq(parameters.runAPIScan, true) }}: |
78 | 66 | - template: api-scan.yml
|
79 | 67 | parameters:
|
80 | 68 | mainBranchName: ${{ parameters.mainBranchName }}
|
81 | 69 |
|
82 |
| - # after the build is complete |
83 |
| - - pwsh: | |
84 |
| - $srcExists = (Test-Path "${{ parameters.signListPath }}") |
85 |
| - $dstExists = (Test-Path "${{ parameters.artifactsPath }}\SignList.xml") |
86 |
| - if ($srcExists -and !$dstExists) { |
87 |
| - Copy-Item "${{ parameters.signListPath }}" "${{ parameters.artifactsPath }}\SignList.xml" |
88 |
| - Write-Host "Copied ${{ parameters.signListPath }} to ${{ parameters.artifactsPath }}\SignList.xml" |
89 |
| - } elseif (!$srcExists) { |
90 |
| - Write-Host "${{ parameters.signListPath }} did not exist, nothing copied." |
91 |
| - } elseif ($dstExists) { |
92 |
| - Write-Host "${{ parameters.artifactsPath }}\SignList.xml already existed, nothing copied." |
93 |
| - } |
94 |
| - displayName: 'Copy SignList.xml to the nuget artifact' |
95 |
| - - task: PublishBuildArtifacts@1 |
96 |
| - displayName: 'Publish artifacts' |
97 |
| - condition: or(eq('${{ parameters.publishJob }}', ''), eq('${{ parameters.publishJob }}', variables['System.JobName'])) |
98 |
| - inputs: |
99 |
| - PathToPublish: ${{ parameters.artifactsPath }} |
100 |
| - ArtifactName: nuget |
101 |
| - - task: PublishBuildArtifacts@1 |
102 |
| - displayName: 'Publish platform artifacts' |
103 |
| - condition: always() |
104 |
| - inputs: |
105 |
| - PathToPublish: output |
106 |
| - ArtifactName: output-$(System.JobName)${{ parameters.publishOutputSuffix }} |
107 |
| - # run any required checks |
108 |
| - - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: |
109 |
| - - task: ComponentGovernanceComponentDetection@0 |
110 |
| - displayName: 'Run component detection' |
111 |
| - condition: and(always(), eq('refs/heads/${{ parameters.mainBranchName }}', variables['Build.SourceBranch'])) |
112 |
| - inputs: |
113 |
| - scanType: 'Register' |
114 |
| - verbosity: 'Verbose' |
115 |
| - alertWarningLevel: 'High' |
116 |
| - |
117 |
| - - template: code-analysis.yml |
118 |
| - parameters: |
119 |
| - name: ${{ parameters.name }} |
120 |
| - mainBranchName: ${{ parameters.mainBranchName }} |
121 |
| - areaPath: ${{ parameters.areaPath }} |
122 |
| - configuration: ${{ parameters.configuration }} |
| 70 | + # Copy SignList.xml to output |
| 71 | + - pwsh: | |
| 72 | + $srcExists = (Test-Path "${{ parameters.signListPath }}") |
| 73 | + $dstExists = (Test-Path "${{ parameters.artifactsPath }}\SignList.xml") |
| 74 | + if ($srcExists -and !$dstExists) { |
| 75 | + Copy-Item "${{ parameters.signListPath }}" "${{ parameters.artifactsPath }}\SignList.xml" |
| 76 | + Write-Host "Copied ${{ parameters.signListPath }} to ${{ parameters.artifactsPath }}\SignList.xml" |
| 77 | + } elseif (!$srcExists) { |
| 78 | + Write-Host "${{ parameters.signListPath }} did not exist, nothing copied." |
| 79 | + } elseif ($dstExists) { |
| 80 | + Write-Host "${{ parameters.artifactsPath }}\SignList.xml already existed, nothing copied." |
| 81 | + } |
| 82 | + displayName: Copy SignList.xml to output |
0 commit comments