229 строки
8.8 KiB
YAML
229 строки
8.8 KiB
YAML
variables:
|
|
BuildVersion: $[counter('release-counter', 1)]
|
|
IsRunningOnCI: true
|
|
DotNet.Cli.Telemetry.OptOut: true
|
|
provisionator.path: '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
|
|
provisionator.vs: '$(System.DefaultWorkingDirectory)/eng/provisioning/vs.csx'
|
|
provisionator.extraArguments: '--v'
|
|
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/') )
|
|
)
|
|
)
|
|
|
|
parameters:
|
|
- name: BuildConfigurations
|
|
type: object
|
|
default:
|
|
- name: Debug
|
|
poolName: $(windowsNet6VmPool)
|
|
vmImage: $(windowsNet6VmImage)
|
|
- name: Release
|
|
poolName: $(windowsNet6VmPool)
|
|
vmImage: $(windowsNet6VmPool)
|
|
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- main
|
|
- release/*
|
|
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
|
|
- release/*
|
|
paths:
|
|
include:
|
|
- '*'
|
|
exclude:
|
|
- .github/*
|
|
- docs/*
|
|
- CODE-OF-CONDUCT.md
|
|
- CONTRIBUTING.md
|
|
- LICENSE.TXT
|
|
- PATENTS.TXT
|
|
- README.md
|
|
- SECURITY.md
|
|
- THIRD-PARTY-NOTICES.TXT
|
|
|
|
resources:
|
|
repositories:
|
|
- repository: xamarin-templates
|
|
type: github
|
|
name: xamarin/yaml-templates
|
|
endpoint: xamarin
|
|
ref: refs/heads/main
|
|
|
|
stages:
|
|
- stage: windows
|
|
displayName: Build Windows
|
|
jobs:
|
|
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
|
|
- job: win_hosted_${{ BuildConfiguration.name }}
|
|
workspace:
|
|
clean: all
|
|
displayName: Build Windows Phase (${{ BuildConfiguration.name }})
|
|
timeoutInMinutes: 60
|
|
pool:
|
|
name: ${{ BuildConfiguration.poolName }}
|
|
vmImage: ${{ BuildConfiguration.vmImage }}
|
|
steps:
|
|
|
|
- template: /eng/pipelines/common/provision.yml
|
|
parameters:
|
|
platform: 'windows'
|
|
|
|
- task: NuGetToolInstaller@0
|
|
displayName: install new nuget
|
|
inputs:
|
|
versionSpec: '5.x'
|
|
|
|
- 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
|
|
|
|
- pwsh: dotnet tool restore
|
|
displayName: install dotnet tools
|
|
|
|
- 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
|
|
|
|
- pwsh: |
|
|
dotnet build ./build/DotNet/DotNet.csproj -p:DotNetDirectory="$env:DOTNET_ROOT" -p:InstallDotNet=false
|
|
displayName: install dotnet workloads
|
|
errorActionPreference: stop
|
|
|
|
- pwsh: |
|
|
Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1'
|
|
# Fix sdk band version in Tizen script
|
|
((Get-Content -path .\workload-install.ps1 -Raw) -replace "\`$ManifestBaseName-\`$DotnetVersionBand","`$ManifestBaseName-6.0.200") | Set-Content -Path .\workload-install.ps1
|
|
.\workload-install.ps1
|
|
displayName: install tizen
|
|
|
|
- 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)
|
|
condition: eq(variables['provisioningWindowsSdk'], 'true')
|
|
|
|
- pwsh: |
|
|
# $VS_ROOT = (& dotnet vs where --prop=InstallationPath)[0]
|
|
$VS_ROOT = 'C:\Program Files\Microsoft Visual Studio\2022\Preview'
|
|
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
|
|
|
|
- pwsh: |
|
|
& $env:MSBUILD_EXE /r /m ./build/Build.Microsoft.Maui.Graphics.Windows.sln /p:Configuration=${{ BuildConfiguration.name }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}.binlog
|
|
displayName: build classic solutions~
|
|
|
|
- pwsh: |
|
|
& $env:MSBUILD_EXE /r /m ./Microsoft.Maui.Graphics-net6.sln /p:Configuration=${{ BuildConfiguration.name }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}-net6.binlog
|
|
displayName: build net6 solutions
|
|
|
|
- task: NuGetCommand@2
|
|
displayName: 'Pack nupkg'
|
|
inputs:
|
|
command: 'pack'
|
|
packagesToPack: '**\Microsoft.Maui.*.nuspec'
|
|
packDestination: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}'
|
|
configuration: ${{ BuildConfiguration.name }}
|
|
basePath: '$(System.DefaultWorkingDirectory)'
|
|
versioningScheme : 'byEnvVar'
|
|
versionEnvVar: 'BUILD_BUILDNUMBER'
|
|
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy SignList.xml and Packages'
|
|
inputs:
|
|
Contents: |
|
|
**/SignList.xml
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration.name }}'
|
|
flattenFolders: true
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
condition: always()
|
|
displayName: publish artifacts
|
|
inputs:
|
|
ArtifactName: nuget
|
|
|
|
# only sign using the private server
|
|
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
|
|
- stage: nuget_signing
|
|
dependsOn: windows
|
|
displayName: Sign Nuget
|
|
jobs:
|
|
- template: sign-artifacts/jobs/v2.yml@xamarin-templates
|
|
parameters:
|
|
signType: Real
|
|
teamName: Maui
|
|
usePipelineArtifactTasks: false
|
|
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
|
|
artifactPath: release
|
|
signedArtifactName: nuget
|
|
signedArtifactPath: signed
|
|
displayName: Sign Phase
|
|
condition: and(succeeded(), ${{ variables['signingCondition'] }} )
|
|
|
|
- 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'
|
|
condition: not(${{ variables['signingCondition'] }}) # Executed when signing is not enabled such as for pull request builds (PRs)
|
|
|
|
- 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'
|
|
condition: and(succeeded(), ${{ variables['signingCondition'] }} ) # Executed when signing is enabled such as for continuous integration builds (CIs) |