maui/eng/pipelines/handlers.yml

298 строки
10 KiB
YAML
Исходник Обычный вид История

trigger:
branches:
include:
- main
2021-04-24 20:06:28 +03:00
- release/*
- net9.0
2022-11-28 14:05:58 +03:00
- net8.0
2021-03-11 19:23:29 +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-04-24 21:19:50 +03:00
- release/*
- net9.0
2022-11-28 14:05:58 +03:00
- net8.0
paths:
include:
- '*'
exclude:
- .github/*
- docs/*
- CODE-OF-CONDUCT.md
- CONTRIBUTING.md
- LICENSE.TXT
- PATENTS.TXT
- README.md
- SECURITY.md
- THIRD-PARTY-NOTICES.TXT
variables:
- template: /eng/pipelines/common/variables.yml
- template: templates/common/vs-release-vars.yml@sdk-insertions
parameters:
- name: provisionatorChannel
displayName: 'Provisionator channel'
type: string
default: 'latest' # Support for launching a build against a Provisionator PR (e.g., pr/[github-account-name]/[pr-number]) as a means to test in-progress Provisionator changes
- name: BuildEverything
type: boolean
default: false
- name: BuildConfigurations
type: object
default:
- Debug
- Release
- name: BuildPlatforms
type: object
default:
- name: Windows
poolName: $(windowsVmPool)
vmImage: $(windowsVmImage)
artifact: build-windows
- name: macOS
poolName: $(macOSXVmPool)
vmImage: $(macOSXVmImage)
artifact: build-macos
- name: PackPlatforms
type: object
default:
- name: Windows
poolName: $(windowsVmPool)
vmImage: $(windowsVmImage)
artifact: nuget
- name: macOS
poolName: $(macOSXVmPool)
vmImage: $(macOSXVmImage)
artifact: nuget-macos
- name: BuilTemplatePlatforms
type: object
default:
- name: Windows
poolName: $(windowsVmPool)
vmImage: $(windowsVmImage)
artifact: build-windows
- name: macOS
poolName: $(macOSXVmPool)
vmImage: $(macOSXVmImage)
artifact: build-macos
- name: RunTemplatePlatforms
type: object
default:
- name: $(androidTestsVmPool)
vmImage: $(androidTestsVmImage)
demands:
- macOS.Name -equals Sonoma
- macOS.Architecture -equals x64
testName: RunOnAndroid
artifact: templates-run-android
- name: $(iosTestsVmPool)
vmImage: $(iosTestsVmImage)
demands:
- macOS.Name -equals Sonoma
- macOS.Architecture -equals x64
testName: RunOniOS
artifact: templates-run-ios
- name: TestTargetFrameworks
type: object
default:
- name: default
tfm: default
- name: net8
tfm: net8.0
resources:
repositories:
- repository: yaml-templates
type: github
name: xamarin/yaml-templates
endpoint: xamarin
ref: refs/heads/main
- repository: sdk-insertions
type: github
name: xamarin/sdk-insertions
ref: refs/heads/main
endpoint: xamarin
stages:
2022-11-28 14:05:58 +03:00
- stage: build_net
displayName: Build .NET MAUI
dependsOn: []
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
2022-11-28 14:05:58 +03:00
- job: build_net_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
workspace:
clean: all
displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
timeoutInMinutes: 240
condition: or(
${{ parameters.BuildEverything }},
ne(variables['Build.Reason'], 'PullRequest'),
eq('${{ BuildConfiguration }}', 'Release'))
pool:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
2022-03-28 20:20:40 +03:00
demands:
- macOS.Name -equals Sonoma
2022-03-28 20:20:40 +03:00
- macOS.Architecture -equals x64
steps:
- template: common/provision.yml
parameters:
[ci] Target the Mac internal-macOS-11 hosted agent pool (#4241) * Target the internal-macOS-11 hosted agent pool * Pool name letter casing: internal-macos-11 * Update 'macOS' letter casing in BuildPlatform.name conditions * Fix spacing * Repo reference to yaml-templates * Fix: Template references: yaml-templates -> xamarin-templates * Agent.OSArchitecture is not defined as a capability on agents in the internal-macos-11 pool * Select .NET 6 * UseDotNet task title: Use .NET SDK 6 * Provision needed dependencies on hosted Mac pool Provisioning: Support for 'provisioning' parameter, which is set when macOS is true * Use alternate expansion for parameters.provisioning setting * provision: Always provision additional software on macOS * Dedicated provisioning step & script for mono * Dedicated task & script for provisioning Xamarin.Mac * Provision additional software when running against an on-prem agent pool and not a hosted pool * Fix: Provision Additional Software: Conditional syntax missing closing paren * Provision Additional Software condition: Remove superfluous space * Apply desired set of on-prem pool demands to ensure build is vectored to an x64 Big Sur machine having no devices or pairing * Only apply shared pool demands when running on an agent in the shared pool * agent-cleanser: Only cleanse off mono & Xamarin.Mac when run on a hosted agent. Then provision the versions that the pipeline needs * Fix: agent-cleanser parameters: Terminating colon missing on 'if' conditionals * Fix: Avoid including agent demands when running on a hosted pool * Reset agent Mac pool settings to use macOSXNet6VmPool and macOSXNet6VmImage variables * Simplify demands to apply only to the shared pool * Remove special handling for cleansing & reinstall of mono and Xamarin.Mac. Depend on the versions provided by the agent * TEST: Target hosted pool to ensure pipeline works there * Revert test changes: Target Mac agent pools defined on build def
2022-01-26 13:50:07 +03:00
poolName: ${{ BuildPlatform.poolName }}
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
- pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 'Install .NET'
retryCountOnTaskFailure: 3
[ci] Allow to build agains internal sdks (#4591) (#4624) * [ci] setup internal .NET builds Context: https://github.com/xamarin/xamarin-android-private/commit/5c8a5432fa20e26926caee470ed3391010d33a93 To consume private .NET 6 builds we need two parts: 1. Run `SetupNugetSources.ps1` with credentials to update the `NuGet.config` file to private feeds. 2. Run `dotnet-install.ps1/sh` with `--azure-feed` and `--feed-credential`. To do this we need the variable groups: # SetupNugetSources - group: AzureDevOps-Artifact-Feeds-Pats # dotnet-install - group: DotNet-MSRC-Storage * Fix empty parameter * Bump to .NET SDK 6.0.100-rc.2.21478.25 * Add "tools" to global.json * Setup dotnet-install.ps1/sh * Fixes for $DOTNET_TOKEN * More fixes * Update DotNet.csproj * Try script type variable syntax * Update version * Bump sdk version * Update DotNet.csproj * use dotnetbuilds-internal-container-uri * Fix variable * use dotnetbuilds-internal-container-read-token * Push more changes to $(dotnetbuilds-internal-container-read-token) * test again * Remove AOT * try this * Revert "Remove AOT" This reverts commit 28b9e6aca4e232831cc5bc198fd2b5225aaedbd0. * Update tools.ps1 * Try not use sources * Update global.json * Revert "Update global.json" This reverts commit 1bc350aac6ebd760a14b3799ba133c7c693a4a8d. * Revert "Try not use sources" This reverts commit 3528400cd50da602e2d60cf43198baf5cbd15899. * Skip dotnet6-internal-transport for workload sources * Revert "Revert "Try not use sources"" This reverts commit 704369edf324696a5122f95b15cfbfa7676dd2e8. * Remove souces from Install target * Revert "Remove souces from Install target" This reverts commit 4337163ee98a315bafade7291e8bc9ee307e3f1e. * Try speciy packages path on nuget.config * Don't use full path * Try use --configfile * Revert "Try use --configfile" This reverts commit d4983c021f0166d82a87c9ee27615a00bd4542c9. * Try add source from exec command * Fix when no token exists * Try fix condition to run private build * Fix yaml * Revert not needed change * Copy nuget.config file to other location * Fix Copy task * Fix command * Remove _ReadAllNuGetSources and specify configfile * [ci] Agent-Cleanser: Ensure .NET cleansing is turned on (#4595) * Agent-Cleanser: Ensure .NET cleansing is turned on * Revise Agent-Cleanser comment explaining why CleanseAgentToolsDotNet is being set * [ci] Add agent cleaner to device tests (#4618) * [ci] Add agent cleaner to device tests * Fix yaml * Add cleanup to device steps * [ci] Pass variables to dotnet install on device tests * Fix get pool name Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com> Co-authored-by: Peter Collins <pecolli@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Mike Bond <mjbond-msft@outlook.com> Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com> Co-authored-by: Peter Collins <pecolli@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Mike Bond <mjbond-msft@outlook.com>
2022-02-11 12:57:09 +03:00
env:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)
- pwsh: ./build.ps1 --target=dotnet-build --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 'Build .NET Maui'
- pwsh: ./build.ps1 --target=dotnet-test --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName: 'Run Unit Tests'
- task: PublishTestResults@2
condition: always()
inputs:
testRunner: VSTest
testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx'
- task: PublishBuildArtifacts@1
condition: always()
displayName: Publish Artifacts (${{ BuildPlatform.artifact }})
inputs:
ArtifactName: ${{ BuildPlatform.artifact }}
2022-11-28 14:05:58 +03:00
- stage: pack_net
displayName: Pack .NET MAUI
Make .NET 6 Packable (#13881) * Add some common nupkg properties to everything * Remove project property refactored into directory build props * Remove properties now in common dir build props * Add net6 version of project * More net6 * Only target netstandard2.0 now net4* is no longer needed as there's no more vs2017 support * Clean up strong naming a bit * Update dependencies * Package all the things for build tasks in the -t:Pack * Add more net6 project versions * Clean up whitespace * Needed moar NET6 * Name fixes * Added meta project for packaging and package script * Remove assembly copyright (now duplicates) * Add resizetizer, add params to package script * Disable strong naming for now We need to re-evaluate how we do this a bit, we should probably use the `al` tool to do it now, and I believe the StrongNamer package may not work anymore, but we can do the same thing in a custom target at a later date. * Fix path to tasks assembly * don't build ios on android specific project * Finish rename of toolbox file * - add cake * - fix cake extras * fix the copy for the IDE * Try packing on CI * versions baby! * build release * this should od it * this * oops * Move to an empty folder * Use new symbol formats * no symbols for build tasks and the head * symbol all the things * Compiler error with commented out code XD * oopsies * only build transitive * Try this * log everything * This might work * REPORTS * previews * needed * versions * duh * Update build.cake Co-authored-by: Shane Neuville <shneuvil@microsoft.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2021-03-02 20:36:17 +03:00
dependsOn: []
jobs:
- ${{ each PackPlatform in parameters.PackPlatforms }}:
2022-11-28 14:05:58 +03:00
- job: pack_net_${{ PackPlatform.name }}
workspace:
clean: all
displayName: ${{ PackPlatform.name }}
timeoutInMinutes: 240
pool:
name: ${{ PackPlatform.poolName }}
vmImage: ${{ PackPlatform.vmImage }}
2022-03-28 20:20:40 +03:00
demands:
- macOS.Name -equals Sonoma
2022-03-28 20:20:40 +03:00
- macOS.Architecture -equals x64
[ci] Move to arcade , remove GitInfo and Mono dependencies (#21487) * try add internal * needs missing paths * [arcade] Add arcade files * Try build with arcade * Update internal * try other pool * Update default image for sdl * try same pool for pack * Update arcade release * Remove gitinfo and update global.jso * update nuget * try again * More updates * Dont sign * Fix package icon * Update Controls.Build.Tasks.csproj * Update Controls.Build.Tasks.csproj * need set versions * tre * Use ArtifactsBinDir * new binaries folder * isShiping true * more cleanup * add post build * fix * try official * try again * DebugType to portable ? * use one versions * Add publish_build_assets * again * again * Wrap on arcade job * again * use self * again * try again * dupe * remove dupes * add Build Config * More variables * push * Fix merge * update to find the path * Update scripts * Add build config * Update android scripts * Remove more xunit versions * Update xunit * Update versions * update more * try this * Fix versions * Remove the test sdk by default * Can this be false? * No need to reference xunit.runner.visualstudio * IsTestProject to false * Fix more device tests paths * Assembly should be 1.0 * Try fix msbuild tests * Fix file version test * Fix some culture tests * try fix restore for next step * Disable fileversion test * Fix androidtests * Fix android app finding * Fix * maybe this way it lauches * Try compat * Fix versions * Fix image tests * Try without this * Fix build * Update windows.cake * Update windows.cake * Update windows.cake * Update provisioning.csx * remove reference test sdk * remove extra * try fix compat uitests * Fix build * build control gallery uitest with dotnet test * Remove nunit console * Fix pushing test results for compat tests * Set correct property msbuild props * Update arcade * Update Directory.Build.props * Update Version.Details.xml * Fix logs artifacts * update source gen tests * Use PackageIconFullPath so Arcade adds our file * Remove file not used * [ci] Push rollback for branch name * Add Compatibility.UnitTests to sln * Update dotnet.cake * Update AssemblyInfoTests.cs * Update pack.yml * Remove extra files * Update Microsoft.Maui.sln * Update Microsoft.Maui-dev.sln * Update pipeline * Fix internal * Try new catalyst cleanup * Update catalyst * Update iOS cake * Fix Cg-gallery on iOS * try again * Refactor android cake * Fix catalyst not finding the app * Make sure to handle results all platforms * Fix naming and test results --------- Co-authored-by: Rui Marinho <ruimarinho@MSFT-M3-PRO.ihome> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2024-05-07 15:49:39 +03:00
variables:
- name: _buildScript
value: $(Build.SourcesDirectory)/build.cmd -ci
- name: _BuildConfig
value: Release
- name: _BuildOfficalId
value: $[ format('{0}.{1}', format('{0:yyyyMMdd}', pipeline.startTime), counter(format('{0:yyyyMMdd}', pipeline.startTime), 1) )]
steps:
- template: common/pack.yml
parameters:
platform: ${{ PackPlatform.name }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
artifact: ${{ PackPlatform.artifact }}
2024-05-21 23:04:32 +03:00
artifactsPath: $(Build.ArtifactStagingDirectory)
artifactBinaries: 'pack-binaries'
[ci] Move to arcade , remove GitInfo and Mono dependencies (#21487) * try add internal * needs missing paths * [arcade] Add arcade files * Try build with arcade * Update internal * try other pool * Update default image for sdl * try same pool for pack * Update arcade release * Remove gitinfo and update global.jso * update nuget * try again * More updates * Dont sign * Fix package icon * Update Controls.Build.Tasks.csproj * Update Controls.Build.Tasks.csproj * need set versions * tre * Use ArtifactsBinDir * new binaries folder * isShiping true * more cleanup * add post build * fix * try official * try again * DebugType to portable ? * use one versions * Add publish_build_assets * again * again * Wrap on arcade job * again * use self * again * try again * dupe * remove dupes * add Build Config * More variables * push * Fix merge * update to find the path * Update scripts * Add build config * Update android scripts * Remove more xunit versions * Update xunit * Update versions * update more * try this * Fix versions * Remove the test sdk by default * Can this be false? * No need to reference xunit.runner.visualstudio * IsTestProject to false * Fix more device tests paths * Assembly should be 1.0 * Try fix msbuild tests * Fix file version test * Fix some culture tests * try fix restore for next step * Disable fileversion test * Fix androidtests * Fix android app finding * Fix * maybe this way it lauches * Try compat * Fix versions * Fix image tests * Try without this * Fix build * Update windows.cake * Update windows.cake * Update windows.cake * Update provisioning.csx * remove reference test sdk * remove extra * try fix compat uitests * Fix build * build control gallery uitest with dotnet test * Remove nunit console * Fix pushing test results for compat tests * Set correct property msbuild props * Update arcade * Update Directory.Build.props * Update Version.Details.xml * Fix logs artifacts * update source gen tests * Use PackageIconFullPath so Arcade adds our file * Remove file not used * [ci] Push rollback for branch name * Add Compatibility.UnitTests to sln * Update dotnet.cake * Update AssemblyInfoTests.cs * Update pack.yml * Remove extra files * Update Microsoft.Maui.sln * Update Microsoft.Maui-dev.sln * Update pipeline * Fix internal * Try new catalyst cleanup * Update catalyst * Update iOS cake * Fix Cg-gallery on iOS * try again * Refactor android cake * Fix catalyst not finding the app * Make sure to handle results all platforms * Fix naming and test results --------- Co-authored-by: Rui Marinho <ruimarinho@MSFT-M3-PRO.ihome> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2024-05-07 15:49:39 +03:00
buildConfiguration: $(_BuildConfig)
dotnetScript: $(Build.SourcesDirectory)/dotnet.cmd
buildScript: $(_buildScript)
repoArtifactsPath: $(Build.Arcade.ArtifactsPath)
repoLogPath: $(Build.Arcade.LogsPath)
repoTestResultsPath: $(Build.Arcade.TestResultsPath)
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
officialBuildId: $(_BuildOfficalId)
prepareSteps:
- template: common/provision.yml
parameters:
checkoutDirectory: '$(System.DefaultWorkingDirectory)'
provisionatorChannel: ${{ parameters.provisionatorChannel }}
gitHubToken: $(github--pat--vs-mobiletools-engineering-service2)
skipAndroidImages: true
2022-11-28 14:05:58 +03:00
- stage: samples_net
displayName: Test .NET MAUI Samples
2022-11-28 14:05:58 +03:00
dependsOn: pack_net
jobs:
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- job: build_net_${{ BuildPlatform.name }}_samples
workspace:
clean: all
displayName: ${{ BuildPlatform.name }}
timeoutInMinutes: 120
pool:
name: ${{ BuildPlatform.poolName }}
vmImage: ${{ BuildPlatform.vmImage }}
demands:
- macOS.Name -equals Sonoma
- macOS.Architecture -equals x64
steps:
- template: common/provision.yml
parameters:
poolName: ${{ BuildPlatform.poolName }}
- task: DownloadBuildArtifacts@0
displayName: 'Download Packages'
inputs:
artifactName: nuget
itemPattern: '**/*.nupkg'
downloadPath: $(System.DefaultWorkingDirectory)/artifacts
- pwsh: Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force
displayName: Move the downloaded artifacts
- pwsh: ./build.ps1 --target=dotnet-local-workloads --verbosity=diagnostic
displayName: 'Install .NET (Local Workloads)'
retryCountOnTaskFailure: 3
env:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)
- pwsh: ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic
displayName: Build Microsoft.Maui.IntegrationTests
- pwsh: ./build.ps1 --target=dotnet-integration-test --filter="FullyQualifiedName=Microsoft.Maui.IntegrationTests.SampleTests" --resultsfilename="integration-samples" --verbosity=diagnostic
displayName: Run ${{ BuildPlatform.name }} sample build tests
- task: PublishTestResults@2
displayName: Publish the ${{ BuildPlatform.name }} sample build tests
condition: always()
inputs:
testRunner: VSTest
testResultsFiles: '$(build.artifactstagingdirectory)/**/*.trx'
testRunTitle: ${{ BuildPlatform.name }} sample build tests
2021-08-26 01:51:03 +03:00
2022-11-28 14:05:58 +03:00
- stage: templates_net
displayName: Test Templates
2022-11-28 14:05:58 +03:00
dependsOn: pack_net
2021-08-26 01:51:03 +03:00
jobs:
- template: common/maui-templates.yml
parameters:
RunPlatforms: ${{ parameters.RunTemplatePlatforms }}
BuildPlatforms: ${{ parameters.BuilTemplatePlatforms }}
2021-03-04 22:41:31 +03:00
2024-05-23 13:46:42 +03:00
# - ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
# - template: common/localization-handoff.yml # Process outgoing strings [Localization Handoff]
# - template: common/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback]
# - template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback]