2020-09-29 13:15:20 +03:00
trigger :
branches :
include :
- main
2021-04-24 20:06:28 +03:00
- release/*
2022-05-31 21:55:26 +03:00
- net7.0
2022-11-28 14:05:58 +03:00
- net8.0
2023-11-28 17:41:17 +03:00
- net9.0
2021-05-05 20:56:05 +03:00
- loc
2021-03-11 19:23:29 +03:00
tags :
include :
- '*'
2020-09-29 13:15:20 +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
pr :
branches :
include :
- main
2021-04-24 21:19:50 +03:00
- release/*
2022-05-31 21:55:26 +03:00
- net7.0
2022-11-28 14:05:58 +03:00
- net8.0
2023-11-28 17:41:17 +03:00
- net9.0
2020-09-29 13:15:20 +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
schedules :
- cron : "0 0 * * *"
displayName : Daily midnight build
branches :
include :
- main
variables :
- template : /eng/pipelines/common/variables.yml
2022-02-08 17:50:58 +03:00
- template : templates/common/vs-release-vars.yml@sdk-insertions
2020-09-29 13:15:20 +03:00
2021-03-17 05:35:08 +03:00
parameters :
2022-02-14 17:49:38 +03:00
- 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
2021-03-17 05:35:08 +03:00
- name : BuildEverything
type : boolean
default : false
2023-12-20 13:58:15 +03:00
- name : RunCompliance
type : boolean
default : false
2021-03-17 05:35:08 +03:00
- name : BuildConfigurations
type : object
default :
- Debug
- Release
- name : BuildPlatforms
type : object
default :
2021-08-06 19:45:26 +03:00
- name : Windows
2021-06-17 14:20:48 +03:00
poolName : $(windowsNet6VmPool)
vmImage : $(windowsNet6VmImage)
2021-03-17 05:35:08 +03:00
bootsAndroid : $(Android.Msi)
2022-06-16 20:15:28 +03:00
artifact : build-windows
2021-08-06 19:45:26 +03:00
- name : macOS
2021-03-17 05:35:08 +03:00
poolName : $(macOSXNet6VmPool)
vmImage : $(macOSXNet6VmImage)
bootsAndroid : $(Android.Pkg)
bootsMacCatalyst : $(MacCatalyst.Pkg)
2022-06-16 20:15:28 +03:00
artifact : build-macos
2023-12-20 13:58:15 +03:00
2021-03-17 05:35:08 +03:00
- name : PackPlatforms
type : object
default :
2021-08-06 19:45:26 +03:00
- name : Windows
2021-06-17 14:20:48 +03:00
poolName : $(windowsNet6VmPool)
vmImage : $(windowsNet6VmImage)
2021-03-17 05:35:08 +03:00
bootsAndroid : $(Android.Msi)
2021-04-07 01:16:25 +03:00
artifact : nuget
2021-08-06 19:45:26 +03:00
- name : macOS
2021-06-17 14:20:48 +03:00
poolName : $(macOSXNet6VmPool)
vmImage : $(macOSXNet6VmImage)
2021-03-17 05:35:08 +03:00
bootsAndroid : $(Android.Pkg)
bootsMacCatalyst : $(MacCatalyst.Pkg)
2021-04-07 01:16:25 +03:00
artifact : nuget-macos
2023-08-03 20:10:24 +03:00
- name : RunTemplatePlatforms
type : object
default :
- name : $(androidTestsVmPool)
vmImage : $(androidTestsVmImage)
demands :
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
2023-10-17 13:57:00 +03:00
- Agent.OSVersion -equals 13.5
2023-08-03 20:10:24 +03:00
testName : RunOnAndroid
artifact : templates-run-android
- name : $(iosTestsVmPool)
vmImage : $(iosTestsVmImage)
demands :
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
2023-10-17 13:57:00 +03:00
- Agent.OSVersion -equals 13.5
2023-08-03 20:10:24 +03:00
testName : RunOniOS
artifact : templates-run-ios
2022-06-23 02:23:53 +03:00
- name : TestTargetFrameworks
type : object
default :
- name : default
tfm : default
2022-11-24 18:46:27 +03:00
# - name: net6
# tfm: net6.0
2023-11-28 17:41:17 +03:00
- name : net9
tfm : net9.0
2021-03-17 05:35:08 +03:00
2020-09-29 13:15:20 +03:00
resources :
repositories :
2022-11-08 15:54:41 +03:00
- repository : yaml-templates
2020-09-29 13:15:20 +03:00
type : github
name : xamarin/yaml-templates
endpoint : xamarin
2022-02-10 04:39:51 +03:00
ref : refs/heads/main
2022-02-08 17:50:58 +03:00
- repository : sdk-insertions
type : github
name : xamarin/sdk-insertions
ref : refs/heads/main
endpoint : xamarin
2020-09-29 13:15:20 +03:00
stages :
2021-03-17 05:35:08 +03:00
2022-11-28 14:05:58 +03:00
- stage : build_net
2022-06-16 20:15:28 +03:00
displayName : Build .NET MAUI
2021-03-17 21:59:35 +03:00
dependsOn : [ ]
jobs :
2021-08-06 19:45:26 +03:00
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
2022-11-28 14:05:58 +03:00
- job : build_net_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
2021-08-06 19:45:26 +03:00
workspace :
clean : all
displayName : ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
2022-11-10 15:23:24 +03:00
timeoutInMinutes : 240
2021-08-06 19:45:26 +03:00
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 :
2023-05-03 13:52:15 +03:00
- macOS.Name -equals Ventura
2022-03-28 20:20:40 +03:00
- macOS.Architecture -equals x64
2023-10-17 13:57:00 +03:00
- Agent.OSVersion -equals 13.5
2021-08-06 19:45:26 +03:00
steps :
- template : common/provision.yml
parameters :
2022-01-26 13:50:07 +03:00
poolName : ${{ BuildPlatform.poolName }}
2023-01-23 18:44:25 +03:00
gitHubToken : $(github--pat--vs-mobiletools-engineering-service2)
2021-08-06 19:45:26 +03:00
- pwsh : ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
displayName : 'Install .NET'
2022-02-16 09:59:06 +03:00
retryCountOnTaskFailure : 3
2022-02-11 12:57:09 +03:00
env :
DOTNET_TOKEN : $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD : $(PrivateBuild)
2021-08-06 19:45:26 +03:00
- 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 }}
2021-03-17 21:59:35 +03:00
2022-11-28 14:05:58 +03:00
- stage : pack_net
2022-06-16 20:15:28 +03:00
displayName : Pack .NET MAUI
2021-03-02 20:36:17 +03:00
dependsOn : [ ]
jobs :
2022-02-22 20:09:46 +03:00
- ${{ each PackPlatform in parameters.PackPlatforms }}:
2022-11-28 14:05:58 +03:00
- job : pack_net_${{ PackPlatform.name }}
2021-03-17 05:35:08 +03:00
workspace :
clean : all
2022-02-22 20:09:46 +03:00
displayName : ${{ PackPlatform.name }}
2022-11-10 15:23:24 +03:00
timeoutInMinutes : 240
2021-03-17 05:35:08 +03:00
pool :
2022-02-22 20:09:46 +03:00
name : ${{ PackPlatform.poolName }}
vmImage : ${{ PackPlatform.vmImage }}
2022-03-28 20:20:40 +03:00
demands :
2023-05-03 13:52:15 +03:00
- macOS.Name -equals Ventura
2022-03-28 20:20:40 +03:00
- macOS.Architecture -equals x64
2023-10-17 13:57:00 +03:00
- Agent.OSVersion -equals 13.5
2021-03-17 05:35:08 +03:00
steps :
2022-02-22 20:09:46 +03:00
- template : common/pack.yml
2021-08-06 19:45:26 +03:00
parameters :
2022-02-22 20:09:46 +03:00
platform : ${{ PackPlatform.name }}
poolName : ${{ PackPlatform.poolName }}
2022-02-14 17:49:38 +03:00
provisionatorChannel : ${{ parameters.provisionatorChannel }}
2022-02-22 20:09:46 +03:00
artifact : ${{ PackPlatform.artifact }}
2023-12-20 13:58:15 +03:00
artifactBinaries : 'pack-binaries'
2023-01-23 18:44:25 +03:00
gitHubToken : $(github--pat--vs-mobiletools-engineering-service2)
2021-03-06 04:12:14 +03:00
2022-11-28 14:05:58 +03:00
- stage : samples_net
2023-04-18 16:16:47 +03:00
displayName : Test .NET MAUI Samples
2022-11-28 14:05:58 +03:00
dependsOn : pack_net
2021-02-11 01:24:09 +03:00
jobs :
2021-03-17 05:35:08 +03:00
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
2023-04-18 16:16:47 +03:00
- job : build_net_${{ BuildPlatform.name }}_samples
workspace :
clean : all
displayName : ${{ BuildPlatform.name }}
timeoutInMinutes : 120
pool :
name : ${{ BuildPlatform.poolName }}
vmImage : ${{ BuildPlatform.vmImage }}
demands :
2023-05-03 13:52:15 +03:00
- macOS.Name -equals Ventura
2023-04-18 16:16:47 +03:00
- macOS.Architecture -equals x64
2023-10-17 13:57:00 +03:00
- Agent.OSVersion -equals 13.5
2023-04-18 16:16:47 +03:00
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)
2023-10-12 02:25:49 +03:00
- pwsh : ./build.ps1 --target=dotnet-integration-build --verbosity=diagnostic
2023-04-18 16:16:47 +03:00
displayName : Build Microsoft.Maui.IntegrationTests
2023-10-12 02:25:49 +03:00
- 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()
2023-04-18 16:16:47 +03:00
inputs :
2023-10-12 02:25:49 +03:00
testRunner : VSTest
testResultsFiles : '$(build.artifactstagingdirectory)/**/*.trx'
2023-04-18 16:16:47 +03:00
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
2023-03-23 20:21:28 +03:00
displayName : Test Templates
2022-11-28 14:05:58 +03:00
dependsOn : pack_net
2021-08-26 01:51:03 +03:00
jobs :
2023-03-23 20:21:28 +03:00
- template : common/maui-templates.yml
2023-08-03 20:10:24 +03:00
parameters :
RunPlatforms : ${{ parameters.RunTemplatePlatforms }}
BuildPlatforms : ${{ parameters.BuildPlatforms }}
2021-03-04 22:41:31 +03:00
2021-08-25 13:16:03 +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]
2022-11-03 03:55:04 +03:00
- template : common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback]
2023-12-20 13:58:15 +03:00
- ${{ if or(eq(variables['Build.Reason'], 'Schedule'), parameters.RunCompliance) }}:
- template : security/full/v1.yml@yaml-templates
parameters :
stageDependsOn : 'pack_net'
complianceEnabled : true
complianceTimeoutInMinutes : 480
scanArtifacts : [ 'pack-binaries' ]
antiMalwareEnabled : true
binSkimEnabled : true
#binSkimTargetGlob: '$(Build.ArtifactStagingDirectory)\binaries-to-scan\pack-binaries\src\Controls\src\Nuget\bin\Release\net8.0\*.dll'
sourceGdnSuppressionFile : $(Build.SourcesDirectory)\eng\automation\guardian\source.gdnsuppress
tsaConfigFile : '$(Build.SourcesDirectory)\eng\automation\guardian\tsaoptions-v2.json'
policheckExclusionFile : '$(System.DefaultWorkingDirectory)\eng\automation\guardian\PoliCheck.Exclusions.xml'
policheckGdnSuppressionFilesFolder : '$(System.DefaultWorkingDirectory)\eng\automation\guardian'
credScanEnabled : true
credScanSuppressionFile : '$(System.DefaultWorkingDirectory)\eng\automation\guardian\CredScanSuppressions.json'
enableCodeInspector : true
apiScanEnabled : true
apiScanSoftwareName : 'MAUI'
apiScanSoftwareVersionNum : $(Build.BuildNumber)