Update the nightly WinAppSDK-based pipeline to run jobs in parallel

This commit is contained in:
Geoffrey Trousdale 2023-02-02 09:21:21 -05:00
Родитель a359fcc48c
Коммит a7eee2a0eb
9 изменённых файлов: 62 добавлений и 90 удалений

Просмотреть файл

@ -10,9 +10,9 @@ foreach ( $configFile in $fileList )
$configXml = [xml](Get-Content $configPath)
$configXml.packages.package | Where-Object id -eq 'Microsoft.WindowsAppSDK' | ForEach-Object {
$_.SetAttribute("version", $env:winappsdk_version);
$_.SetAttribute("version", $env:NIGHTLY_WINAPPSDK_VERSION);
Write-Host "Setting the WinAppSDK version for $configfile to $env:winappsdk_version"
Write-Host "Setting the WinAppSDK version for $configfile to $env:NIGHTLY_WINAPPSDK_VERSION"
}
$configXml.Save($configPath)

Просмотреть файл

@ -44,6 +44,15 @@ steps:
filename: cmd
arguments: /c if exist build\pkges\PoliCheckExclusions.txt exit 1
# Print the WinAppSDK version number to be consumed by build\WindowsAppSDK.common.props
- script: |
echo "WinAppSDK version override (optional): $(nightly_winappsdk_version)"
if "$(nightly_winappsdk_version)"=="" (
echo "WinAppSDK version override not set, defaulting to version in build\WindowsAppSdk.common.props"
)
displayName: Display Versions
# Download nuget.exe
- task: BatchScript@1
displayName: Run download-nuget.cmd
@ -55,6 +64,8 @@ steps:
inputs:
targetType: filePath
filePath: build\Apply-WinAppSDK-Version-To-Configs.ps1
env:
NIGHTLY_WINAPPSDK_VERSION: $[variables.nightly_winappsdk_version]
displayName: 'Apply Nightly WinAppSDK version to packages.config files'
# Nuget Authenticate
- task: NuGetAuthenticate@1
@ -70,13 +81,25 @@ steps:
inputs:
scriptType: inlineScript
inlineScript: |
# Set the appropriate nuget config
$nugetConfig = "\build\nuget\azure_pipelines_nuget.config"
if ("${{ parameters.PipelineType }}" -eq "Nightly")
{
$nugetConfig = "\build\nuget\azure_pipelines_nightly_nuget.config"
}
# Enter VS Shell
$env:_MSBDIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\"
.$env:Build_SourcesDirectory\build\Enter-VSShell.ps1 -vsPath $env:_MSBDIR
$env:PATH="$env:Build_SourcesDirectory\build\nuget;$env:PATH"
.$env:Build_SourcesDirectory\build\nuget\nuget.exe restore ($env:Build_SourcesDirectory + "\build\pkges\packages.config") -PackagesDirectory ($env:Build_SourcesDirectory + "\packages") -configFile ($env:Build_SourcesDirectory + "\build\nuget\azure_pipelines_nuget.config") -NonInteractive
# Nuget Restore
.$env:Build_SourcesDirectory\build\nuget\nuget.exe restore ($env:Build_SourcesDirectory + "\build\pkges\packages.config") -PackagesDirectory ($env:Build_SourcesDirectory + "\packages") -configFile ($env:Build_SourcesDirectory + $nugetConfig) -NonInteractive
# Nuget Restore for AnyCPU projects
$env:Platform="AnyCPU"
$env:Configuration="Release"
.$env:Build_SourcesDirectory\build\nuget\nuget.exe restore .\Microsoft.Graphics.Win2D.sln -PackagesDirectory ($env:Build_SourcesDirectory + "\packages") -configFile ($env:Build_SourcesDirectory + "\build\nuget\azure_pipelines_nuget.config") -NonInteractive
.$env:Build_SourcesDirectory\build\nuget\nuget.exe restore .\Microsoft.Graphics.Win2D.sln -PackagesDirectory ($env:Build_SourcesDirectory + "\packages") -configFile ($env:Build_SourcesDirectory + $nugetConfig) -NonInteractive
rm env:Configuration
rm env:Platform
# Nuget Restore for Telemetry
@ -84,7 +107,7 @@ steps:
displayName: Moving telem files
inputs:
script: |
call nuget.exe restore -NonInteractive -configFile $(Build.SourcesDirectory)/release-nuget.config -PackagesDirectory $(Build.SourcesDirectory)/packages $(Build.SourcesDirectory)/build/release-pkges/packages.config || exit /b 1
call nuget.exe restore -NonInteractive -configFile $(Build.SourcesDirectory)/build/nuget/release-nuget.config -PackagesDirectory $(Build.SourcesDirectory)/packages $(Build.SourcesDirectory)/build/release-pkges/packages.config || exit /b 1
del $(Build.SourcesDirectory)\winrt\inc\MicrosoftTelemetry.h || exit /b 1
move /Y $(Build.SourcesDirectory)\packages\Microsoft.Win2D.Telemetry.1.0.2\build\include\MicrosoftTelemetry.h $(Build.SourcesDirectory)\winrt\inc\MicrosoftTelemetry.h || exit /b 1
@ -93,7 +116,7 @@ steps:
displayName: Build Win2D.proj
inputs:
solution: Win2D.proj
msbuildVersion: 16.0
msbuildVersion: 17.0
msbuildArguments: /p:BuildTests=${{ parameters.BuildTests }} /p:BuildDocs=${{ parameters.BuildDocs }} /p:BuildTools=${{ parameters.BuildTools }} /p:RunTests=false /p:BuildPlatforms="$(architecture)" /p:BuildConfigurations="$(buildConfiguration)"
maximumCpuCount: true

Просмотреть файл

@ -14,7 +14,7 @@ parameters:
# Build Win2D code and nuget package
stages:
- stage: Build_Win2D
- stage: Version_Win2D
jobs:
# Set Version Number
- job: Version
@ -25,9 +25,11 @@ stages:
- template: Win2D-VersionNumber.yml
parameters:
PipelineType: ${{ parameters.PipelineType }}
- stage: Build_Win2D
dependsOn: Version_Win2D
jobs:
# Build Win2D in parallel
- job: Build_Win2D
dependsOn: Version
strategy:
matrix:
x86:
@ -50,7 +52,8 @@ stages:
pool:
vmImage: '${{ parameters.VMImage }}'
variables:
version: $[ dependencies.Version.outputs['version'] ]
${{ if eq(parameters.PipelineType, 'Nightly') }}:
nightly_winappsdk_version: $[ stageDependencies.Version_Win2D.Version.outputs['Win2dVersionTask.nightly_winappsdk_version'] ]
steps:
- template: Win2D-ParallelBuild-Steps.yml
parameters:
@ -72,7 +75,7 @@ stages:
- ${{ if parameters.RunTests }}:
- stage: Test_Win2D
# Empty dependency
dependsOn:
dependsOn: Version_Win2D
jobs:
- job: Test_Win2D
strategy:
@ -85,17 +88,15 @@ stages:
architecture: "x64"
archDirectory: "uapx64"
buildConfiguration: "Release"
# Test projects don't support ARM and ARM64 right now
# ARM:
# architecture: "ARM"
# buildConfiguration: "Release"
# Test projects don't support ARM64 right now
# ARM64:
# architecture: "ARM64"
# buildConfiguration: "Release"
pool:
vmImage: '${{ parameters.VMImage }}'
variables:
version: $[ dependencies.Version.outputs['version'] ]
${{ if eq(parameters.PipelineType, 'Nightly') }}:
nightly_winappsdk_version: $[ stageDependencies.Version_Win2D.Version.outputs['Win2dVersionTask.nightly_winappsdk_version'] ]
steps:
- template: Win2D-ParallelBuild-Steps.yml
parameters:

Просмотреть файл

@ -34,8 +34,7 @@ steps:
$xmlfile.Dependencies.ProductDependencies.Dependency | Where-Object Name -eq 'Microsoft.WindowsAppSDK' | ForEach-Object {
$WIN_APP_SDK_VERSION = $_.Version
Write-Host "The WinAppSDK Version is $WIN_APP_SDK_VERSION"
Write-Host "##vso[task.setvariable variable=winappsdk_version]$WIN_APP_SDK_VERSION"
Write-Host "##vso[task.setvariable variable=winappsdk_version;isOutput=true]$WIN_APP_SDK_VERSION"
Write-Host "##vso[task.setvariable variable=nightly_winappsdk_version;isOutput=true]$WIN_APP_SDK_VERSION"
}
$env:packageSuffix = $env:packageSuffix + "-WinAppSDK." + $WIN_APP_SDK_VERSION
}

Просмотреть файл

@ -15,76 +15,12 @@ parameters:
default: True
variables:
- name: PackageSuffix
value: $[format('Nightly-{0:yyMMdd}.{1}', pipeline.startTime, counter(format('{0}.{1}', variables['Build.DefinitionName'], format('{0:yyMMdd}', pipeline.startTime)), 0))]
value: $[format('Win2D.WinUI-Nightly-{0:yyMMdd}.{1}', pipeline.startTime, counter(format('{0}.{1}', variables['Build.DefinitionName'], format('{0:yyMMdd}', pipeline.startTime)), 0))]
# Run the Pipeline
stages:
- template: AzurePipelineTemplates\Win2D-Stages.yml
- template: AzurePipelinesTemplates\Win2D-Stages.yml
parameters:
RunTests: ${{ parameters.RunTests }}
PipelineType: 'Nightly'
SignCode: false
pool:
vmImage: 'windows-2019'
variables:
- name: date
value: $[format('{0:yyMMdd}', pipeline.startTime)]
name: $[format('{0}.{1}.Nightly', variables['date'], counter(variables['date']))]
jobs:
# Set Version for Win2D
- job: Win2DVersioning
pool:
vmImage: 'windows-2019'
variables:
# Codesigning not needed for this job
- name: runCodesignValidationInjection
value: false
steps:
- template: AzurePipelinesTemplates\Win2D-Find-WinAppSDK-Version.yml
- template: AzurePipelinesTemplates\Win2D-VersionNumber.yml
# Build Win2D
- job: BuildProduct
dependsOn: 'Win2DVersioning'
pool:
vmImage: 'windows-2019'
variables:
- name: version
value: $[format('{0}.{1}', dependencies.Win2DVersioning.outputs['win2dVersionTask.versionNightly'], counter(dependencies.Win2DVersioning.outputs['win2dVersionTask.versionNightly']))]
- name: winappsdk_version
value: $[dependencies.Win2DVersioning.outputs['winappsdkVersionTask.winappsdk_version']]
steps:
# Update package.config files with Nightly WinAppSDK version
- task: powershell@2
inputs:
targetType: filePath
filePath: build\Apply-WinAppSDK-Version-To-Configs.ps1
displayName: 'Apply Nightly WinAppSDK version to packages.config files'
# Build Win2D
- template: AzurePipelinesTemplates\Win2D-Build-Steps.yml
parameters:
isRelease: false
isNightly: true
# Run tests
- job: TestProduct
dependsOn: 'Win2DVersioning'
pool:
name: 'Hosted Windows 2019 with VS2019'
variables:
- name: winappsdk_version
value: $[dependencies.Win2DVersioning.outputs['winappsdkVersionTask.winappsdk_version']]
steps:
# Update package.config files with Nightly WinAppSDK version
- task: powershell@2
inputs:
targetType: filePath
filePath: build\Apply-WinAppSDK-Version-To-Configs.ps1
displayName: 'Apply Nightly WinAppSDK version to packages.config files'
# Test Win2D
- template: AzurePipelinesTemplates\Win2D-Test-Steps.yml
SignCode: false

Просмотреть файл

@ -3,10 +3,10 @@
<PropertyGroup>
<!-- This value controls all of the projects consuming the WindowsAppSdk and centralizes it in one spot.
When updating the version, don't forget to update all of the package.config files as well.
The AzureDevOps pipeline will override the version here by setting WINAPPSDK_VERSION in the nightly build.
The AzureDevOps pipeline will override the version here by setting NIGHTLY_WINAPPSDK_VERSION in the nightly build.
That nightly version is read from \eng\Version.Details.xml -->
<WindowsAppSdkVersion Condition="'$(WINAPPSDK_VERSION)' == ''">1.0.4</WindowsAppSdkVersion>
<WindowsAppSdkVersion Condition="'$(WINAPPSDK_VERSION)' != ''">$(WINAPPSDK_VERSION)</WindowsAppSdkVersion>
<WindowsAppSdkVersion Condition="'$(NIGHTLY_WINAPPSDK_VERSION)' == ''">1.0.4</WindowsAppSdkVersion>
<WindowsAppSdkVersion Condition="'$(NIGHTLY_WINAPPSDK_VERSION)' != ''">$(NIGHTLY_WINAPPSDK_VERSION)</WindowsAppSdkVersion>
<_PackagesPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\packages'))</_PackagesPath>
<_WindowsAppSdkPackageRoot>$(_PackagesPath)\Microsoft.WindowsAppSdk.$(WindowsAppSdkVersion)</_WindowsAppSdkPackageRoot>

Просмотреть файл

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="Project.Reunion.nuget.internal" value="https://pkgs.dev.azure.com/microsoft/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<Project.Reunion.nuget.internal>
<add key="Username" value="adouser" />
<add key="ClearTextPassword" value="%REUNION_FEED%" />
</Project.Reunion.nuget.internal>
</packageSourceCredentials>
</configuration>

Просмотреть файл

Просмотреть файл

@ -11,11 +11,11 @@ Licensed under the MIT License. See LICENSE.txt in the project root for license
defined in build\WindowsAppSdk.common.props -->
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.WindowsAppSDK" Version="1.0.0">
<Dependency Name="Microsoft.WindowsAppSDK" Version="1.1.0">
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal</Uri>
<Sha>26a4f01996caf57be507bf8fc5bf5fe1292edec2</Sha>
<Sha>e9f6d119a70db6516304e4ed00b080ce46dc4bee</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
</ToolsetDependencies>
</Dependencies>
</Dependencies>