2021-03-26 13:37:05 +03:00
|
|
|
variables:
|
2021-05-27 20:10:19 +03:00
|
|
|
BuildVersion: $[counter('release-counter', 1)]
|
|
|
|
IsRunningOnCI: true
|
2021-07-09 16:53:53 +03:00
|
|
|
DotNet.Cli.Telemetry.OptOut: true
|
2022-01-06 04:58:13 +03:00
|
|
|
provisionator.path: '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
|
|
|
|
provisionator.vs: '$(System.DefaultWorkingDirectory)/eng/provisioning/vs.csx'
|
|
|
|
provisionator.extraArguments: '--v'
|
2022-02-24 18:59:53 +03:00
|
|
|
signingCondition: 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/') )
|
|
|
|
)
|
|
|
|
)
|
2021-03-26 13:37:05 +03:00
|
|
|
|
2021-03-26 23:09:23 +03:00
|
|
|
parameters:
|
|
|
|
- name: BuildConfigurations
|
|
|
|
type: object
|
|
|
|
default:
|
2022-02-25 18:13:19 +03:00
|
|
|
- name: Debug
|
|
|
|
poolName: $(windowsNet6VmPool)
|
|
|
|
vmImage: $(windowsNet6VmImage)
|
|
|
|
- name: Release
|
2022-02-25 22:31:55 +03:00
|
|
|
poolName: $(windowsNet6VmPool)
|
|
|
|
vmImage: $(windowsNet6VmPool)
|
2021-03-26 23:09:23 +03:00
|
|
|
|
2021-03-18 19:41:34 +03:00
|
|
|
trigger:
|
2021-03-26 13:25:46 +03:00
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- main
|
2021-06-21 12:23:47 +03:00
|
|
|
- release/*
|
2022-03-23 18:05:48 +03:00
|
|
|
- darc-*
|
2021-03-26 13:25:46 +03:00
|
|
|
tags:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
paths:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
exclude:
|
|
|
|
- .github/*
|
|
|
|
- docs/*
|
|
|
|
- CODE-OF-CONDUCT.md
|
|
|
|
- CONTRIBUTING.md
|
|
|
|
- LICENSE.TXT
|
|
|
|
- PATENTS.TXT
|
|
|
|
- README.md
|
|
|
|
- SECURITY.md
|
|
|
|
- THIRD-PARTY-NOTICES.TXT
|
|
|
|
|
|
|
|
pr:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- main
|
2021-08-31 01:38:08 +03:00
|
|
|
- release/*
|
2021-03-26 13:25:46 +03:00
|
|
|
paths:
|
|
|
|
include:
|
|
|
|
- '*'
|
|
|
|
exclude:
|
|
|
|
- .github/*
|
|
|
|
- docs/*
|
|
|
|
- CODE-OF-CONDUCT.md
|
|
|
|
- CONTRIBUTING.md
|
|
|
|
- LICENSE.TXT
|
|
|
|
- PATENTS.TXT
|
|
|
|
- README.md
|
|
|
|
- SECURITY.md
|
|
|
|
- THIRD-PARTY-NOTICES.TXT
|
2021-04-21 02:47:11 +03:00
|
|
|
|
2021-03-26 23:09:23 +03:00
|
|
|
resources:
|
|
|
|
repositories:
|
|
|
|
- repository: xamarin-templates
|
|
|
|
type: github
|
|
|
|
name: xamarin/yaml-templates
|
|
|
|
endpoint: xamarin
|
2022-02-24 18:59:53 +03:00
|
|
|
ref: refs/heads/main
|
2021-03-18 19:41:34 +03:00
|
|
|
|
2021-03-26 23:09:23 +03:00
|
|
|
stages:
|
|
|
|
- stage: windows
|
|
|
|
displayName: Build Windows
|
|
|
|
jobs:
|
2021-07-09 16:30:57 +03:00
|
|
|
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
|
2022-02-25 18:13:19 +03:00
|
|
|
- job: win_hosted_${{ BuildConfiguration.name }}
|
2021-03-26 23:09:23 +03:00
|
|
|
workspace:
|
|
|
|
clean: all
|
2022-02-25 18:13:19 +03:00
|
|
|
displayName: Build Windows Phase (${{ BuildConfiguration.name }})
|
2021-03-26 23:09:23 +03:00
|
|
|
timeoutInMinutes: 60
|
|
|
|
pool:
|
2022-02-25 18:13:19 +03:00
|
|
|
name: ${{ BuildConfiguration.poolName }}
|
|
|
|
vmImage: ${{ BuildConfiguration.vmImage }}
|
2021-03-26 23:09:23 +03:00
|
|
|
steps:
|
2021-09-16 00:07:34 +03:00
|
|
|
|
2022-01-06 03:58:21 +03:00
|
|
|
- template: /eng/pipelines/common/provision.yml
|
|
|
|
parameters:
|
|
|
|
platform: 'windows'
|
2022-01-06 03:49:42 +03:00
|
|
|
|
2021-09-16 00:07:34 +03:00
|
|
|
- task: NuGetToolInstaller@0
|
|
|
|
displayName: install new nuget
|
|
|
|
inputs:
|
|
|
|
versionSpec: '5.x'
|
|
|
|
|
2022-03-23 22:29:58 +03:00
|
|
|
- pwsh: |
|
|
|
|
$DOTNET_ROOT = "$env:ProgramFiles\dotnet"
|
|
|
|
$env:DOTNET_ROOT = $DOTNET_ROOT
|
|
|
|
echo "##vso[task.setvariable variable=DOTNET_ROOT]$DOTNET_ROOT"
|
|
|
|
displayName: set up the .NET root envvar
|
|
|
|
errorActionPreference: stop
|
|
|
|
|
2021-07-09 16:30:57 +03:00
|
|
|
- pwsh: dotnet tool restore
|
2021-05-27 20:45:48 +03:00
|
|
|
displayName: install dotnet tools
|
2022-03-24 14:19:18 +03:00
|
|
|
|
|
|
|
- pwsh: |
|
|
|
|
[xml] $fileXml = Get-Content "eng\Versions.props"
|
|
|
|
$DotNetVersion = $fileXml.SelectSingleNode("Project/PropertyGroup/MicrosoftDotnetSdkInternalPackageVersion").InnerText
|
|
|
|
$DotNetVersionBand = $fileXml.SelectSingleNode("Project/PropertyGroup/DotNetVersionBand").InnerText
|
|
|
|
echo "Installing .NET $DotNetVersion"
|
|
|
|
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
|
|
|
|
& .\dotnet-install.ps1 -Version $DotNetVersion -InstallDir "$env:DOTNET_ROOT" -Verbose
|
|
|
|
echo "Removing signing"
|
|
|
|
& "${env:ProgramFiles(x86)}\Windows Kits\10\App Certification Kit\signtool.exe" remove /s "$env:DOTNET_ROOT\sdk\$DotNetVersionBand\dotnet.dll"
|
|
|
|
echo "Listing installed SDKs"
|
|
|
|
& dotnet --list-sdks
|
|
|
|
displayName: install .NET
|
|
|
|
errorActionPreference: stop
|
|
|
|
|
2022-03-24 15:26:19 +03:00
|
|
|
- pwsh: ./build.ps1 --target=dotnet-local-workloads --configuration="${{ BuildConfiguration.name }}" --verbosity=diagnostic --installdotnet=false
|
2022-03-24 15:08:31 +03:00
|
|
|
displayName: 'install .NET workloads'
|
2022-03-23 20:41:54 +03:00
|
|
|
retryCountOnTaskFailure: 3
|
|
|
|
env:
|
|
|
|
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
|
|
|
|
PRIVATE_BUILD: $(PrivateBuild)
|
2022-03-24 14:19:18 +03:00
|
|
|
|
2021-09-16 00:07:34 +03:00
|
|
|
- pwsh: |
|
2022-04-09 03:41:43 +03:00
|
|
|
[xml] $fileXml = Get-Content "eng\Versions.props"
|
|
|
|
$DotNetVersionBand = $fileXml.SelectSingleNode("Project/PropertyGroup/DotNetVersionBand").InnerText
|
2022-01-21 18:58:46 +03:00
|
|
|
Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1'
|
2022-05-04 06:07:47 +03:00
|
|
|
.\workload-install.ps1 -DotnetTargetVersionBand $DotNetVersionBand
|
2021-08-12 22:23:27 +03:00
|
|
|
displayName: install tizen
|
|
|
|
|
2021-11-03 19:44:45 +03:00
|
|
|
- pwsh: |
|
|
|
|
$uri = 'https://go.microsoft.com/fwlink/?linkid=2083338'
|
|
|
|
Invoke-WebRequest -Uri $uri -OutFile winsdksetup.exe
|
|
|
|
.\winsdksetup.exe /norestart /quiet | Out-Null
|
|
|
|
dir "C:\Program Files (x86)\Windows Kits\10\References\"
|
|
|
|
displayName: install Windows 10 SDK, version 1903 (10.0.18362.1)
|
2022-02-25 19:16:24 +03:00
|
|
|
condition: eq(variables['provisioningWindowsSdk'], 'true')
|
2021-11-03 19:44:45 +03:00
|
|
|
|
2022-01-06 22:57:23 +03:00
|
|
|
- pwsh: |
|
2022-01-07 07:39:19 +03:00
|
|
|
# $VS_ROOT = (& dotnet vs where --prop=InstallationPath)[0]
|
2022-01-07 00:09:55 +03:00
|
|
|
$VS_ROOT = 'C:\Program Files\Microsoft Visual Studio\2022\Preview'
|
2022-01-06 22:57:23 +03:00
|
|
|
echo "##vso[task.setvariable variable=VS_ROOT]$VS_ROOT"
|
|
|
|
$MSBUILD_EXE = "$VS_ROOT\MSBuild\Current\Bin\MSBuild.exe"
|
|
|
|
echo "##vso[task.setvariable variable=MSBUILD_EXE]$MSBUILD_EXE"
|
|
|
|
echo "Using MSBuild: $MSBUILD_EXE"
|
|
|
|
displayName: set up the msbuild envvar
|
|
|
|
errorActionPreference: stop
|
2021-11-17 01:28:34 +03:00
|
|
|
|
2022-02-25 20:51:55 +03:00
|
|
|
- pwsh: |
|
|
|
|
& $env:MSBUILD_EXE /r /m ./build/Build.Microsoft.Maui.Graphics.Windows.sln /p:Configuration=${{ BuildConfiguration.name }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}.binlog
|
2022-03-23 21:26:20 +03:00
|
|
|
displayName: build classic solutions
|
2022-02-25 19:26:51 +03:00
|
|
|
|
2021-07-13 05:44:37 +03:00
|
|
|
- pwsh: |
|
2022-03-23 22:29:58 +03:00
|
|
|
& $env:MSBUILD_EXE /r /m ./Microsoft.Maui.Graphics-net6.sln /p:Configuration=${{ BuildConfiguration.name }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}-net6.binlog
|
2021-07-13 05:44:37 +03:00
|
|
|
displayName: build net6 solutions
|
2021-07-09 16:44:41 +03:00
|
|
|
|
2021-05-28 20:39:12 +03:00
|
|
|
- task: NuGetCommand@2
|
|
|
|
displayName: 'Pack nupkg'
|
|
|
|
inputs:
|
|
|
|
command: 'pack'
|
2021-08-12 22:23:27 +03:00
|
|
|
packagesToPack: '**\Microsoft.Maui.*.nuspec'
|
2022-02-25 18:18:56 +03:00
|
|
|
packDestination: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}'
|
|
|
|
configuration: ${{ BuildConfiguration.name }}
|
2021-05-28 20:39:12 +03:00
|
|
|
basePath: '$(System.DefaultWorkingDirectory)'
|
|
|
|
versioningScheme : 'byEnvVar'
|
|
|
|
versionEnvVar: 'BUILD_BUILDNUMBER'
|
2021-07-09 16:30:57 +03:00
|
|
|
|
2021-03-27 02:32:40 +03:00
|
|
|
- task: CopyFiles@2
|
2021-05-28 11:46:56 +03:00
|
|
|
displayName: 'Copy SignList.xml and Packages'
|
2021-03-27 02:32:40 +03:00
|
|
|
inputs:
|
2021-05-28 11:46:56 +03:00
|
|
|
Contents: |
|
|
|
|
**/SignList.xml
|
2022-02-25 18:18:56 +03:00
|
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}'
|
2021-03-27 02:32:40 +03:00
|
|
|
flattenFolders: true
|
2021-03-18 20:38:53 +03:00
|
|
|
|
2021-03-26 23:09:23 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
condition: always()
|
|
|
|
displayName: publish artifacts
|
|
|
|
inputs:
|
|
|
|
ArtifactName: nuget
|
2021-03-18 20:38:53 +03:00
|
|
|
|
2021-07-09 16:30:57 +03:00
|
|
|
# only sign using the private server
|
2021-03-26 23:09:23 +03:00
|
|
|
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
|
|
|
|
- stage: nuget_signing
|
2021-03-26 23:11:31 +03:00
|
|
|
dependsOn: windows
|
2021-03-26 23:09:23 +03:00
|
|
|
displayName: Sign Nuget
|
|
|
|
jobs:
|
|
|
|
- template: sign-artifacts/jobs/v2.yml@xamarin-templates
|
|
|
|
parameters:
|
2021-06-23 12:50:36 +03:00
|
|
|
signType: Real
|
2021-03-26 23:09:23 +03:00
|
|
|
teamName: Maui
|
|
|
|
usePipelineArtifactTasks: false
|
|
|
|
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
|
2021-03-27 01:49:56 +03:00
|
|
|
artifactPath: release
|
2021-03-26 23:09:23 +03:00
|
|
|
signedArtifactName: nuget
|
|
|
|
signedArtifactPath: signed
|
|
|
|
displayName: Sign Phase
|
2022-02-24 18:59:53 +03:00
|
|
|
condition: and(succeeded(), ${{ variables['signingCondition'] }} )
|
2022-02-15 18:40:39 +03:00
|
|
|
|
2022-03-25 19:50:23 +03:00
|
|
|
- job: push_signed_nugets
|
|
|
|
displayName: Push To Maestro
|
|
|
|
dependsOn: signing
|
|
|
|
condition: eq(dependencies.signing.result, 'Succeeded')
|
|
|
|
timeoutInMinutes: 60
|
|
|
|
pool: VSEngSS-MicroBuild2022-1ES
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
variables:
|
|
|
|
- group: Publish-Build-Assets
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Signed Packages
|
|
|
|
inputs:
|
|
|
|
artifactName: nuget
|
2022-03-25 21:39:27 +03:00
|
|
|
downloadPath: $(Build.StagingDirectory)\nuget
|
2022-03-25 19:50:23 +03:00
|
|
|
patterns: |
|
|
|
|
**/signed/*.nupkg
|
|
|
|
|
|
|
|
- powershell: >-
|
|
|
|
& dotnet build -v:n
|
|
|
|
-t:PushManifestToBuildAssetRegistry
|
|
|
|
-p:BuildAssetRegistryToken=$(MaestroAccessToken)
|
2022-03-25 21:39:27 +03:00
|
|
|
-p:OutputPath=$(Build.StagingDirectory)\nuget\signed\
|
2022-03-25 19:50:23 +03:00
|
|
|
$(System.DefaultWorkingDirectory)\build\DotNet\Dependencies\Workloads.csproj
|
|
|
|
displayName: generate and publish BAR manifest
|
|
|
|
condition: and(succeeded(), eq(variables['PushPackageInfoToMaestro'], 'true'))
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$versionEndpoint = 'https://maestro-prod.westus2.cloudapp.azure.com/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 --skip-assets-publishing --password $(MaestroAccessToken) --azdev-pat $(publishing-dnceng-devdiv-code-r-build-re)
|
|
|
|
displayName: add build to default darc channel
|
|
|
|
condition: and(succeeded(), eq(variables['PushPackageInfoToMaestro'], 'true'))
|
2022-03-25 19:39:24 +03:00
|
|
|
|
2022-04-12 19:24:37 +03:00
|
|
|
- stage: sbom
|
|
|
|
displayName: 'Software Bill of Materials'
|
|
|
|
dependsOn: [ 'windows', 'nuget_signing' ]
|
|
|
|
condition: succeeded('windows')
|
|
|
|
jobs:
|
|
|
|
- template: compliance/sbom/job.v1.yml@xamarin-templates
|
|
|
|
parameters:
|
|
|
|
jobName: SBOM_PR
|
|
|
|
jobDisplayName: 'Software Bill of Materials (PR)'
|
|
|
|
artifactNames: ['nuget']
|
|
|
|
artifactMap: ['nuget/Release']
|
|
|
|
packageName: 'Microsoft Maui Graphics'
|
|
|
|
packageFilter: '*.nupkg'
|
|
|
|
enableSBOMSigning: false
|
|
|
|
condition: not(${{ variables['signingCondition'] }}) # Executed when signing is not enabled such as for pull request builds (PRs)
|
2022-02-24 18:59:53 +03:00
|
|
|
|
2022-04-12 19:24:37 +03:00
|
|
|
- template: compliance/sbom/job.v1.yml@xamarin-templates
|
|
|
|
parameters:
|
|
|
|
jobName: SBOM_CI
|
|
|
|
jobDisplayName: 'Software Bill of Materials (CI)'
|
|
|
|
artifactNames: ['nuget']
|
|
|
|
artifactMap: ['nuget/signed']
|
|
|
|
packageName: 'Microsoft Maui Graphics'
|
|
|
|
packageFilter: '*.nupkg'
|
|
|
|
enableSBOMSigning: false
|
|
|
|
condition: and(succeeded(), ${{ variables['signingCondition'] }} ) # Executed when signing is enabled such as for continuous integration builds (CIs)
|