2020-09-29 13:15:20 +03:00
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- main
|
2021-04-24 20:06:28 +03:00
|
|
|
- release/*
|
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/*
|
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
|
|
|
|
|
2021-03-17 05:35:08 +03:00
|
|
|
parameters:
|
|
|
|
- name: BuildEverything
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
- 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)
|
|
|
|
bootsiOS: $(iOS.Msi)
|
|
|
|
artifact: net6-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)
|
|
|
|
bootsiOS: $(iOS.Pkg)
|
|
|
|
bootsMacCatalyst: $(MacCatalyst.Pkg)
|
|
|
|
artifact: net6-macos
|
|
|
|
- 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)
|
|
|
|
bootsiOS: $(iOS.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)
|
|
|
|
bootsiOS: $(iOS.Pkg)
|
|
|
|
bootsMacCatalyst: $(MacCatalyst.Pkg)
|
2021-04-07 01:16:25 +03:00
|
|
|
artifact: nuget-macos
|
2021-03-17 05:35:08 +03:00
|
|
|
|
2020-09-29 13:15:20 +03:00
|
|
|
resources:
|
|
|
|
repositories:
|
|
|
|
- repository: xamarin-templates
|
|
|
|
type: github
|
|
|
|
name: xamarin/yaml-templates
|
|
|
|
endpoint: xamarin
|
|
|
|
ref: refs/heads/main # still defaults to master even though main is the main branch
|
|
|
|
|
|
|
|
stages:
|
2021-03-17 05:35:08 +03:00
|
|
|
|
2021-08-06 19:45:26 +03:00
|
|
|
- stage: build_net6
|
|
|
|
displayName: Build .NET 6
|
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 }}:
|
|
|
|
- job: build_net6_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
|
|
|
|
timeoutInMinutes: 120
|
|
|
|
condition: or(
|
|
|
|
${{ parameters.BuildEverything }},
|
|
|
|
ne(variables['Build.Reason'], 'PullRequest'),
|
|
|
|
eq('${{ BuildConfiguration }}', 'Release'))
|
|
|
|
pool:
|
|
|
|
name: ${{ BuildPlatform.poolName }}
|
|
|
|
vmImage: ${{ BuildPlatform.vmImage }}
|
|
|
|
steps:
|
|
|
|
- template: common/provision.yml
|
|
|
|
parameters:
|
|
|
|
platform: ${{ BuildPlatform.name }}
|
|
|
|
- pwsh: ./build.ps1 --target=dotnet --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
|
|
|
|
displayName: 'Install .NET'
|
|
|
|
- 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
|
|
|
|
2021-03-06 04:12:14 +03:00
|
|
|
- stage: pack_net6
|
|
|
|
displayName: Pack .NET 6
|
2021-03-02 20:36:17 +03:00
|
|
|
dependsOn: []
|
|
|
|
jobs:
|
2021-03-17 05:35:08 +03:00
|
|
|
- ${{ each BuildPlatform in parameters.PackPlatforms }}:
|
|
|
|
- job: pack_net6_${{ BuildPlatform.name }}
|
|
|
|
workspace:
|
|
|
|
clean: all
|
2021-08-06 19:45:26 +03:00
|
|
|
displayName: ${{ BuildPlatform.name }}
|
2021-03-17 05:35:08 +03:00
|
|
|
timeoutInMinutes: 120
|
|
|
|
pool:
|
|
|
|
name: ${{ BuildPlatform.poolName }}
|
|
|
|
vmImage: ${{ BuildPlatform.vmImage }}
|
|
|
|
steps:
|
2021-08-06 19:45:26 +03:00
|
|
|
- template: common/provision.yml
|
|
|
|
parameters:
|
|
|
|
platform: ${{ BuildPlatform.name }}
|
|
|
|
- pwsh: ./build.ps1 --target=dotnet-pack --configuration="Release" --verbosity=diagnostic
|
|
|
|
displayName: 'Pack .NET Maui'
|
2021-03-17 05:35:08 +03:00
|
|
|
- task: CopyFiles@2
|
2021-06-16 19:59:53 +03:00
|
|
|
condition: always()
|
|
|
|
displayName: 'Copy files to staging'
|
2021-03-17 05:35:08 +03:00
|
|
|
inputs:
|
|
|
|
Contents: |
|
2021-08-06 19:45:26 +03:00
|
|
|
artifacts/**/*.*nupkg
|
2021-09-08 18:22:51 +03:00
|
|
|
artifacts/**/*.zip
|
2021-07-27 17:21:49 +03:00
|
|
|
artifacts/vs-workload.props
|
2021-08-06 19:45:26 +03:00
|
|
|
eng/automation/SignList.xml
|
2021-05-05 00:05:54 +03:00
|
|
|
TargetFolder: $(build.artifactstagingdirectory)
|
|
|
|
flattenFolders: true
|
|
|
|
- task: CopyFiles@2
|
2021-08-06 19:45:26 +03:00
|
|
|
displayName: 'Copy Log Files'
|
2021-05-05 00:05:54 +03:00
|
|
|
condition: always()
|
|
|
|
inputs:
|
|
|
|
Contents: |
|
2021-08-06 19:45:26 +03:00
|
|
|
artifacts/logs/**
|
|
|
|
TargetFolder: $(build.artifactstagingdirectory)/logs
|
2021-03-17 05:35:08 +03:00
|
|
|
flattenFolders: true
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
condition: always()
|
|
|
|
displayName: publish artifacts
|
|
|
|
inputs:
|
|
|
|
ArtifactName: ${{ BuildPlatform.artifact }}
|
2021-03-06 04:12:14 +03:00
|
|
|
|
2021-08-06 19:45:26 +03:00
|
|
|
- stage: samples_net6
|
|
|
|
displayName: Build .NET 6 Samples
|
2021-06-16 19:59:53 +03:00
|
|
|
dependsOn: pack_net6
|
2021-02-11 01:24:09 +03:00
|
|
|
jobs:
|
2021-03-17 05:35:08 +03:00
|
|
|
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
|
2021-08-06 19:45:26 +03:00
|
|
|
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
|
|
|
|
- job: build_net6_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
|
2021-03-17 05:35:08 +03:00
|
|
|
workspace:
|
|
|
|
clean: all
|
2021-08-06 19:45:26 +03:00
|
|
|
displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
|
2021-03-17 05:35:08 +03:00
|
|
|
timeoutInMinutes: 120
|
|
|
|
condition: or(
|
|
|
|
${{ parameters.BuildEverything }},
|
|
|
|
ne(variables['Build.Reason'], 'PullRequest'),
|
2021-08-06 19:45:26 +03:00
|
|
|
eq('${{ BuildConfiguration }}', 'Release'))
|
2021-03-17 05:35:08 +03:00
|
|
|
pool:
|
|
|
|
name: ${{ BuildPlatform.poolName }}
|
|
|
|
vmImage: ${{ BuildPlatform.vmImage }}
|
|
|
|
steps:
|
2021-08-06 19:45:26 +03:00
|
|
|
- template: common/provision.yml
|
|
|
|
parameters:
|
|
|
|
platform: ${{ BuildPlatform.name }}
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download Packages'
|
2021-06-16 19:59:53 +03:00
|
|
|
inputs:
|
2021-08-06 19:45:26 +03:00
|
|
|
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 --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
|
|
|
|
displayName: 'Install .NET (Local Workloads)'
|
|
|
|
- pwsh: ./build.ps1 --target=dotnet-samples --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
|
|
|
|
displayName: 'Build .NET 6 Samples'
|
2021-08-26 01:51:03 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
condition: always()
|
|
|
|
displayName: publish artifacts
|
|
|
|
inputs:
|
|
|
|
ArtifactName: ${{ BuildPlatform.artifact }}
|
|
|
|
|
|
|
|
- stage: templates_net6
|
|
|
|
displayName: Build .NET 6 Templates
|
|
|
|
dependsOn: pack_net6
|
|
|
|
jobs:
|
|
|
|
- ${{ each BuildPlatform in parameters.BuildPlatforms }}:
|
|
|
|
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
|
|
|
|
- job: build_net6_${{ BuildPlatform.name }}_${{ BuildConfiguration }}
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
displayName: ${{ BuildPlatform.name }} (${{ BuildConfiguration }})
|
|
|
|
timeoutInMinutes: 120
|
|
|
|
condition: or(
|
|
|
|
${{ parameters.BuildEverything }},
|
|
|
|
ne(variables['Build.Reason'], 'PullRequest'),
|
|
|
|
eq('${{ BuildConfiguration }}', 'Release'))
|
|
|
|
pool:
|
|
|
|
name: ${{ BuildPlatform.poolName }}
|
|
|
|
vmImage: ${{ BuildPlatform.vmImage }}
|
|
|
|
steps:
|
|
|
|
- template: common/provision.yml
|
|
|
|
parameters:
|
|
|
|
platform: ${{ BuildPlatform.name }}
|
|
|
|
- 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 --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
|
|
|
|
displayName: 'Install .NET (Local Workloads)'
|
|
|
|
- pwsh: ./build.ps1 --target=dotnet-templates --configuration="${{ BuildConfiguration }}" --verbosity=diagnostic
|
|
|
|
displayName: 'Build .NET 6 Templates'
|
2021-03-17 05:35:08 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
condition: always()
|
|
|
|
displayName: publish artifacts
|
|
|
|
inputs:
|
|
|
|
ArtifactName: ${{ BuildPlatform.artifact }}
|
2021-03-04 22:41:31 +03:00
|
|
|
|
2021-05-05 20:04:05 +03:00
|
|
|
- template: common/security_compliance.yml
|
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]
|
|
|
|
- template: common/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback]
|
2021-06-14 21:17:39 +03:00
|
|
|
|
2021-05-05 20:04:05 +03:00
|
|
|
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}: # Sign only using the private server
|
2021-03-04 22:41:31 +03:00
|
|
|
- stage: nuget_signing
|
2021-03-06 04:36:17 +03:00
|
|
|
dependsOn: pack_net6
|
2021-03-04 22:41:31 +03:00
|
|
|
displayName: Sign Nuget
|
|
|
|
jobs:
|
|
|
|
- template: sign-artifacts/jobs/v2.yml@xamarin-templates
|
|
|
|
parameters:
|
2021-05-08 01:58:58 +03:00
|
|
|
signType: Real
|
2021-07-27 17:21:49 +03:00
|
|
|
teamName: $(TeamName)
|
2021-03-04 22:41:31 +03:00
|
|
|
usePipelineArtifactTasks: false
|
|
|
|
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
|
|
|
|
signedArtifactName: nuget
|
|
|
|
signedArtifactPath: signed
|
|
|
|
displayName: Sign Phase
|
2021-06-18 18:38:21 +03:00
|
|
|
condition: and(succeeded(), 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-07-27 17:21:49 +03:00
|
|
|
|
|
|
|
- template: nuget-msi-convert/job/v2.yml@xamarin-templates
|
|
|
|
parameters:
|
|
|
|
yamlResourceName: xamarin-templates
|
|
|
|
dependsOn: signing
|
|
|
|
artifactName: nuget
|
|
|
|
artifactPatterns: |
|
|
|
|
**/signed/*.nupkg
|
|
|
|
artifactPath: signed
|
|
|
|
propsArtifactName: nuget
|
|
|
|
signType: Real
|
|
|
|
|
|
|
|
- template: vs-insertion/stage/v1.yml@xamarin-templates
|
|
|
|
parameters:
|
|
|
|
dependsOn: nuget_signing
|
2021-07-27 22:37:35 +03:00
|
|
|
approvalTimeoutInMinutes: 30
|
2021-08-26 08:19:47 +03:00
|
|
|
symbolArtifactName: nuget
|
|
|
|
symbolArtifactPatterns: |
|
|
|
|
**/signed/*.nupkg
|
|
|
|
**/*.snupkg
|