SkiaSharp/scripts/azure-templates-stages.yml

1104 строки
49 KiB
YAML

parameters:
- name: buildPipelineType
type: string
default: 'both'
- name: buildExternals
type: string
default: 'latest'
- name: buildAgentHost
type: object
- name: buildAgentWindows
type: object
- name: buildAgentWindowsNative
type: object
- name: buildAgentMac
type: object
- name: buildAgentMacNative
type: object
- name: buildAgentLinux
type: object
- name: buildAgentLinuxNative
type: object
- name: buildAgentAndroidTests
type: object
- name: sdl
type: object
default:
apiscan:
enabled: false
binskim:
break: false
spotBugs:
enabled: false
- name: use1ESPipelineTemplates
type: boolean
default: false
- name: enableSigning
type: boolean
default: false
- name: forceRealSigning
type: boolean
default: false
stages:
- stage: prepare
displayName: Prepare Build
jobs:
- job: prepare # Prepare Build
displayName: Prepare Build
pool: ${{ parameters.buildAgentHost.pool }}
steps:
- checkout: none
- template: /scripts/azure-templates-variables.yml@self
parameters:
updateBuild: true
- ${{ if eq(parameters.buildPipelineType, 'build') }}:
- template: /scripts/azure-templates-github-status.yml@self
parameters:
context: 'SkiaSharp-Tests'
state: 'pending'
displayName: Queue up the status for the tests pipeline
- ${{ if eq(parameters.buildPipelineType, 'tests') }}:
- template: /scripts/azure-templates-github-status.yml@self
- ${{ if ne(parameters.buildPipelineType, 'tests') }}:
- stage: native_windows
displayName: Native Windows
dependsOn: prepare
jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|x86 (Win)
parameters:
name: native_android_x86_windows
displayName: Android x86
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-android
additionalArgs: --buildarch=x86
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|x64 (Win)
parameters:
name: native_android_x64_windows
displayName: Android x64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-android
additionalArgs: --buildarch=x64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|arm (Win)
parameters:
name: native_android_arm_windows
displayName: Android arm
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-android
additionalArgs: --buildarch=arm
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|arm64 (Win)
parameters:
name: native_android_arm64_windows
displayName: Android arm64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-android
additionalArgs: --buildarch=arm64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Tizen (Win)
parameters:
name: native_tizen_windows
displayName: Tizen
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-tizen
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x86 (Win)
parameters:
name: native_win32_x86_windows
displayName: Win32 x86
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x86
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x64 (Win)
parameters:
name: native_win32_x64_windows
displayName: Win32 x64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|arm64 (Win)
parameters:
name: native_win32_arm64_windows
displayName: Win32 arm64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=arm64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x86 (Win + MSVC)
parameters:
name: native_win32_x86_msvc_windows
displayName: Win32 x86 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x86 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|x64 (Win + MSVC)
parameters:
name: native_win32_x64_msvc_windows
displayName: Win32 x64 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=x64 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Win32|arm64 (Win + MSVC)
parameters:
name: native_win32_arm64_msvc_windows
displayName: Win32 arm64 [MSVC]
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-windows
additionalArgs: --buildarch=arm64 --llvm="msvc"
installLlvm: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native WinUI|x86 (Win)
parameters:
name: native_winui_x86_windows
displayName: WinUI x86
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-winui
additionalArgs: --buildarch=x86
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native WinUI|x64 (Win)
parameters:
name: native_winui_x64_windows
displayName: WinUI x64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-winui
additionalArgs: --buildarch=x64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native WinUI|arm64 (Win)
parameters:
name: native_winui_arm64_windows
displayName: WinUI arm64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-winui
additionalArgs: --buildarch=arm64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native ANGLE WinUI|x86 (Win)
parameters:
name: native_winui_angle_x86_windows
displayName: ANGLE WinUI x86
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-winui-angle
additionalArgs: --buildarch=x86
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native ANGLE WinUI|x64 (Win)
parameters:
name: native_winui_angle_x64_windows
displayName: ANGLE WinUI x64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-winui-angle
additionalArgs: --buildarch=x64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native ANGLE WinUI|arm64 (Win)
parameters:
name: native_winui_angle_arm64_windows
displayName: ANGLE WinUI arm64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-winui-angle
additionalArgs: --buildarch=arm64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native NanoServer|x64 (Win)
parameters:
name: native_win32_x64_nanoserver_windows
displayName: Nano Server x64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindowsNative }}
target: externals-nanoserver
additionalArgs: --buildarch=x64
- ${{ if ne(parameters.buildPipelineType, 'tests') }}:
- stage: native_macos
displayName: Native macOS
dependsOn: prepare
jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|x86 (macOS)
parameters:
name: native_android_x86_macos
displayName: Android x86
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-android
additionalArgs: --buildarch=x86
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|x64 (macOS)
parameters:
name: native_android_x64_macos
displayName: Android x64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-android
additionalArgs: --buildarch=x64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|arm (macOS)
parameters:
name: native_android_arm_macos
displayName: Android arm
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-android
additionalArgs: --buildarch=arm
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Android|arm64 (macOS)
parameters:
name: native_android_arm64_macos
displayName: Android arm64
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-android
additionalArgs: --buildarch=arm64
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native iOS (macOS)
parameters:
name: native_ios_macos
displayName: iOS
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-ios
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Mac Catalyst (macOS)
parameters:
name: native_maccatalyst_macos
displayName: Mac Catalyst
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-maccatalyst
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native macOS (macOS)
parameters:
name: native_macos_macos
displayName: macOS
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-macos
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native tvOS (macOS)
parameters:
name: native_tvos_macos
displayName: tvOS
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-tvos
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Tizen (macOS)
parameters:
name: native_tizen_macos
displayName: Tizen
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMacNative }}
target: externals-tizen
- ${{ if ne(parameters.buildPipelineType, 'tests') }}:
- stage: native_linux
displayName: Native Linux
dependsOn: prepare
jobs:
- template: /scripts/azure-templates-linux-matrix.yml@self # Build Native Linux (Linux)
parameters:
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentLinuxNative }}
use1ESPipelineTemplates: ${{ parameters.use1ESPipelineTemplates }}
builds:
- name: ''
- name: nodeps
desc: 'No Deps'
additionalArgs: --verifyExcluded=fontconfig
gnArgs: skia_use_fontconfig=false
matrix:
- arch: x64
docker: scripts/Docker/debian/amd64
- arch: x64
variant: alpine
docker: scripts/Docker/alpine/amd64
- arch: arm
docker: scripts/Docker/debian/clang-cross
target: externals-linux-clang-cross
- arch: arm64
docker: scripts/Docker/debian/clang-cross
dockerArgs: --build-arg TOOLCHAIN_ARCH=aarch64-linux-gnu --build-arg TOOLCHAIN_ARCH_SHORT=arm64
target: externals-linux-clang-cross
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Native Tizen (Linux)
parameters:
name: native_tizen_linux
displayName: Tizen
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentLinuxNative }}
packages: $(TIZEN_LINUX_PACKAGES)
target: externals-tizen
condition: false # https://github.com/mono/SkiaSharp/issues/2933
- ${{ if ne(parameters.buildPipelineType, 'tests') }}:
- stage: native_wasm
displayName: Native WASM
dependsOn: prepare
jobs:
- template: /scripts/azure-templates-wasm-matrix.yml@self # Build Native WASM (Linux)
parameters:
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentLinuxNative }}
use1ESPipelineTemplates: ${{ parameters.use1ESPipelineTemplates }}
emscripten:
- 2.0.6:
displayName: 2.0.6
version: 2.0.6
features: none
- 2.0.23:
displayName: 2.0.23
version: 2.0.23
features: none
# .NET 6
- 3.1.7:
displayName: 3.1.7
version: 3.1.7
features: none
# .NET 7
- 3.1.12:
displayName: 3.1.12
version: 3.1.12
features: st
- 3.1.12:
displayName: '3.1.12_SIMD'
version: 3.1.12
features: st,simd
- 3.1.12:
displayName: '3.1.12_Threading'
version: 3.1.12
features: mt
- 3.1.12:
displayName: '3.1.12_Threading_SIMD'
version: 3.1.12
features: mt,simd
# .NET 8
- 3.1.34:
displayName: 3.1.34
version: 3.1.34
features: _wasmeh,st
- 3.1.34:
displayName: '3.1.34_Threading'
version: 3.1.34
features: _wasmeh,mt
- 3.1.34:
displayName: '3.1.34_SIMD'
version: 3.1.34
features: _wasmeh,st,simd
- 3.1.34:
displayName: '3.1.34_SIMD_Threading'
version: 3.1.34
features: _wasmeh,mt,simd
# .NET 9
- 3.1.56:
displayName: 3.1.56
version: 3.1.56
features: _wasmeh,st
- 3.1.56:
displayName: '3.1.56_Threading'
version: 3.1.56
features: _wasmeh,mt
- 3.1.56:
displayName: '3.1.56_SIMD'
version: 3.1.56
features: _wasmeh,simd,st
- 3.1.56:
displayName: '3.1.56_SIMD_Threading'
version: 3.1.56
features: _wasmeh,simd,mt
- ${{ if ne(parameters.buildPipelineType, 'tests') }}:
- stage: native
displayName: Native
variables:
nativeLinuxJobs: $[ convertToJson(stageDependencies.native_linux) ]
nativeWasmJobs: $[ convertToJson(stageDependencies.native_wasm) ]
dependsOn:
- native_windows
- native_macos
- native_linux
- native_wasm
jobs:
- template: /scripts/azure-templates-merger.yml@self # Merge Native Artifacts
parameters:
name: native
displayName: Merge Native Artifacts
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentHost }}
requiredArtifacts:
# Android
- name: native_android_x86_windows
- name: native_android_x64_windows
- name: native_android_arm_windows
- name: native_android_arm64_windows
# Tizen
- name: native_tizen_windows
# Win32
- name: native_win32_x86_windows
- name: native_win32_x64_windows
- name: native_win32_arm64_windows
# WinUI
- name: native_winui_x86_windows
- name: native_winui_x64_windows
- name: native_winui_arm64_windows
- name: native_winui_angle_x86_windows
- name: native_winui_angle_x64_windows
- name: native_winui_angle_arm64_windows
# Nano Server
- name: native_win32_x64_nanoserver_windows
# iOS
- name: native_ios_macos
# Mac Catalyst
- name: native_maccatalyst_macos
# macOS
- name: native_macos_macos
# tvOS
- name: native_tvos_macos
matrixArtifacts:
- name: native_linux
jobs: $(nativeLinuxJobs)
- name: native_wasm
jobs: $(nativeWasmJobs)
- template: /scripts/azure-templates-merger.yml@self # Merge Native WASM Artifacts
parameters:
name: native_wasm
displayName: Merge Native WASM Artifacts
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentHost }}
matrixArtifacts:
- name: native_wasm
jobs: $(nativeWasmJobs)
- template: /scripts/azure-templates-merger.yml@self # Merge Native MSVC Artifacts
parameters:
name: native_msvc
displayName: Merge Native MSVC Artifacts
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentHost }}
requiredArtifacts:
- name: native_win32_x86_msvc_windows
- name: native_win32_x64_msvc_windows
- name: native_win32_arm64_msvc_windows
- ${{ if ne(parameters.buildPipelineType, 'build') }}:
- stage: managed
displayName: Build Managed
${{ if eq(parameters.buildPipelineType, 'tests') }}:
dependsOn: prepare
${{ if eq(parameters.buildPipelineType, 'both') }}:
dependsOn: native
jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self # Validate Interop
parameters:
name: managed_interop_windows
displayName: Validate Interop
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
target: externals-interop
additionalArgs: --skipExternals="all"
installAndroidSdk: false
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Managed (Windows)
parameters:
name: managed_windows
displayName: Managed (Windows)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
target: libs
additionalArgs: --skipExternals="all"
requiredArtifacts:
- name: native
postBuildSteps:
- pwsh: Remove-Item ./output/native/ -Recurse -Force -ErrorAction Continue
displayName: Delete the native folder
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Managed (macOS)
parameters:
name: managed_macos
displayName: Managed (macOS)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMac }}
target: libs
additionalArgs: --skipExternals="all"
requiredArtifacts:
- name: native
postBuildSteps:
- pwsh: Remove-Item ./output/native/ -Recurse -Force -ErrorAction Continue
displayName: Delete the native folder
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Managed (Linux)
parameters:
name: managed_linux
displayName: Managed (Linux)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentLinux }}
packages: $(MANAGED_LINUX_PACKAGES)
target: libs
additionalArgs: --skipExternals="all"
requiredArtifacts:
- name: native
postBuildSteps:
- pwsh: Remove-Item ./output/native/ -Recurse -Force -ErrorAction Continue
displayName: Delete the native folder
- ${{ if ne(parameters.buildPipelineType, 'tests') }}:
- stage: package
displayName: Package NuGets
dependsOn: native
jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self # Package NuGets
parameters:
name: package_normal_windows
displayName: Package NuGets
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
target: nuget-normal
additionalArgs: --skipExternals="all"
shouldPublish: false
requiredArtifacts:
- name: native
postBuildSteps:
- pwsh: |
Remove-Item ./output/native/ -Recurse -Force -ErrorAction Continue
Move-Item -Path '.\output\' -Destination '$(Build.ArtifactStagingDirectory)\output\'
New-Item '.\output\' -Type Directory -Force | Out-Null
displayName: Re-organize the output folder for publishing
- pwsh: |
Move-Item -Path '$(Build.ArtifactStagingDirectory)\output\nugets\' -Destination '.\output\'
Copy-Item -Path '.\scripts\SignList.xml' -Destination '.\output\nugets\'
displayName: Prepare the nugets artifact for publishing
- pwsh: |
Move-Item -Path '$(Build.ArtifactStagingDirectory)\output\nugets-symbols\' -Destination '.\output\'
displayName: Prepare the nugets-symbols artifact for publishing
- pwsh: |
Move-Item -Path '$(Build.ArtifactStagingDirectory)\output\' -Destination '.\output\'
displayName: Prepare the build artifact for publishing
- pwsh: |
$nupkgs = (Get-ChildItem ".\output\nugets*\*.*nupkg")
foreach ($nupkg in $nupkgs) {
$filename = $nupkg.Name.TrimEnd('.nupkg')
$dest = ".\output\extracted_nugets\$filename"
Write-Host "Extracting '$nupkg' to '$dest'..."
Expand-Archive $nupkg $dest
}
displayName: Extract all the .nupkg files for scanning
publishArtifacts:
- name: package_normal_windows
path: '.\output\output\'
- name: nuget
path: '.\output\nugets'
- name: nuget_symbols
path: '.\output\nugets-symbols'
- template: /scripts/azure-templates-bootstrapper.yml@self # Package Special NuGets
parameters:
name: package_special_windows
displayName: Package Special NuGets
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
dependsOn: package_normal_windows
target: nuget-special
additionalArgs: --skipExternals="all" --exclusive
shouldPublish: false
requiredArtifacts:
- name: native
- name: nuget
dir: nugets
- name: nuget_symbols
dir: nugets-symbols
postBuildSteps:
- pwsh: |
Remove-Item ./output/nugets/ -Recurse -Force -ErrorAction Continue
Remove-Item ./output/nugets-symbols/ -Recurse -Force -ErrorAction Continue
Move-Item -Path '.\output\' -Destination '$(Build.ArtifactStagingDirectory)\output\'
New-Item '.\output\' -Type Directory -Force | Out-Null
displayName: Re-organize the output folder for publishing
- pwsh: |
Move-Item -Path '$(Build.ArtifactStagingDirectory)\output\nugets-special\' -Destination '.\output\'
displayName: Prepare the nugets-special artifact for publishing
- pwsh: |
Move-Item -Path '$(Build.ArtifactStagingDirectory)\output\' -Destination '.\output\'
displayName: Prepare the build artifact for publishing
publishArtifacts:
- name: package_special_windows
path: '.\output\output\'
- name: nuget_special
path: '.\output\nugets-special'
- ${{ if ne(parameters.buildPipelineType, 'build') }}:
- stage: api_diff
displayName: API Diff
${{ if eq(parameters.buildPipelineType, 'tests') }}:
dependsOn: prepare
${{ if eq(parameters.buildPipelineType, 'both') }}:
dependsOn: package
jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self # API Diff
parameters:
name: api_diff_windows
displayName: API Diff
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
target: docs-api-diff
additionalArgs: --nugetDiffPrerelease=$(NUGET_DIFF_PRERELEASE)
shouldPublish: false
requiredArtifacts:
- name: nuget
dir: nugets
preBuildSteps:
- pwsh: .\scripts\install-gtk.ps1
displayName: Install GTK# 2.12
publishArtifacts:
- name: api-diff
always: true
path: '$(Build.SourcesDirectory)\output\api-diff'
- name: changelogs
always: true
path: '$(Build.SourcesDirectory)\changelogs'
- ${{ if eq(parameters.enableSigning, 'true') }}:
- stage: signing
displayName: Sign NuGets
dependsOn: package
jobs:
- template: sign-artifacts/jobs/v3.yml@xamarin-templates
parameters:
${{ if or(eq(parameters.forceRealSigning, 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}:
signType: 'Real'
${{ else }}:
signType: 'Test'
use1ESTemplate: ${{ parameters.use1ESPipelineTemplates }}
usePipelineArtifactTasks: true
- ${{ if ne(parameters.buildPipelineType, 'build') }}:
- stage: tests
displayName: Tests
${{ if eq(parameters.buildPipelineType, 'tests') }}:
dependsOn: prepare
${{ if eq(parameters.buildPipelineType, 'both') }}:
dependsOn: native
jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests|netfx (Windows)
parameters:
name: tests_netfx_windows
displayName: Windows (.NET Framework)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
target: tests-netfx
additionalArgs: --skipExternals="all" --coverage=$(ENABLE_CODE_COVERAGE)
installAndroidSdk: false
shouldPublish: false
requiredArtifacts:
- name: native_win32_x86_windows
- name: native_win32_x64_windows
- name: native_win32_arm64_windows
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the .NET Framework test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/TestResults.xml'
testRunTitle: 'Windows .NET Framework Tests'
publishArtifacts:
- name: testlogs_netfx_windows
always: true
path: 'output/logs/testlogs'
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests|netcore (Windows)
parameters:
name: tests_netcore_windows
displayName: Windows (.NET Core)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
target: tests-netcore
additionalArgs: --skipExternals="all" --coverage=$(ENABLE_CODE_COVERAGE)
installAndroidSdk: false
shouldPublish: false
requiredArtifacts:
- name: native_win32_x86_windows
- name: native_win32_x64_windows
- name: native_win32_arm64_windows
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the .NET Core test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/TestResults.xml'
testRunTitle: 'Windows .NET Core Tests'
publishArtifacts:
- name: testlogs_netcore_windows
always: true
path: 'output/logs/testlogs'
- name: coverage_netcore_windows
path: 'output/coverage'
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests|netcore (macOS)
parameters:
name: tests_netcore_macos
displayName: macOS (.NET Core)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMac }}
target: tests-netcore
additionalArgs: --skipExternals="all" --coverage=$(ENABLE_CODE_COVERAGE)
installAndroidSdk: false
shouldPublish: false
requiredArtifacts:
- name: native_macos_macos
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the .NET Core test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/TestResults.xml'
testRunTitle: 'macOS .NET Core Tests'
publishArtifacts:
- name: testlogs_netcore_macos
always: true
path: 'output/logs/testlogs'
- name: coverage_netcore_macos
path: 'output/coverage'
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests|netcore (Linux)
parameters:
name: tests_netcore_linux
displayName: Linux (.NET Core)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentLinux }}
packages: $(MANAGED_LINUX_PACKAGES)
target: tests-netcore
additionalArgs: --skipExternals="all" --coverage=$(ENABLE_CODE_COVERAGE)
installAndroidSdk: false
shouldPublish: false
requiredArtifacts:
- name: native_linux_x64_linux
- name: native_linux_arm64_linux
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the .NET Core test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/TestResults.xml'
testRunTitle: 'Linux .NET Core Tests'
publishArtifacts:
- name: testlogs_netcore_linux
always: true
path: 'output/logs/testlogs'
- name: coverage_netcore_linux
path: 'output/coverage'
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests|android (macOS)
parameters:
name: tests_android_macos
displayName: Android (macOS)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentAndroidTests }}
target: tests-android
additionalArgs: --device=android-emulator-64 --deviceVersion=$(ANDROID_TEST_DEVICE_VERSION) --skipExternals="all" --coverage=$(ENABLE_CODE_COVERAGE)
shouldPublish: false
requiredArtifacts:
- name: native_android_x86_macos
- name: native_android_x64_macos
- name: native_android_arm_macos
- name: native_android_arm64_macos
preBuildSteps:
- pwsh: .\scripts\install-android-package.ps1 -Package "emulator"
displayName: Install the Android emulator
- pwsh: .\scripts\install-android-package.ps1 -Package "system-images;android-$(ANDROID_TEST_DEVICE_VERSION);google_apis;x86_64"
displayName: Install the Android API $(ANDROID_TEST_DEVICE_VERSION) emulator image
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the Android test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/TestResults.xml'
testRunTitle: 'Android Tests (API $(ANDROID_TEST_DEVICE_VERSION))'
publishArtifacts:
- name: testlogs_android_$(ANDROID_TEST_DEVICE_VERSION)
always: true
path: 'output/logs/testlogs'
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests|ios (macOS)
parameters:
name: tests_ios_macos
displayName: iOS (macOS)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMac }}
target: tests-ios
additionalArgs: --device=ios-simulator-64 --deviceVersion=$(IOS_TEST_DEVICE_VERSION) --skipExternals="all" --coverage=$(ENABLE_CODE_COVERAGE)
shouldPublish: false
requiredArtifacts:
- name: native_ios_macos
preBuildSteps:
- template: /scripts/azure-templates-provisioning-profiles.yml@self
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the iOS test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/TestResults.xml'
testRunTitle: 'iOS Tests (v$(IOS_TEST_DEVICE_VERSION))'
publishArtifacts:
- name: testlogs_ios_$(IOS_TEST_DEVICE_VERSION)
always: true
path: 'output/logs/testlogs'
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests|maccatalyst (macOS)
parameters:
name: tests_maccatalyst_macos
displayName: Mac Catalyst (macOS)
continueOnError: true
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMac }}
target: tests-maccatalyst
additionalArgs: --device=maccatalyst --skipExternals="all" --coverage=$(ENABLE_CODE_COVERAGE)
installAndroidSdk: false
shouldPublish: false
requiredArtifacts:
- name: native_maccatalyst_macos
preBuildSteps:
- template: /scripts/azure-templates-provisioning-profiles.yml@self
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the Mac Catalyst test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/TestResults.xml'
testRunTitle: 'Mac Catalyst Tests'
publishArtifacts:
- name: testlogs_maccatalyst
always: true
path: 'output/logs/testlogs'
- template: /scripts/azure-templates-bootstrapper.yml@self # Tests [WASM] (Linux)
parameters:
name: tests_wasm_linux
displayName: WASM (Linux)
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentLinux }}
packages: $(MANAGED_LINUX_PACKAGES) ninja-build
target: tests-wasm
additionalArgs: --skipExternals="all" --coverage=false --chromedriver=$(CHROMEWEBDRIVER)
installAndroidSdk: false
shouldPublish: false
requiredArtifacts:
- name: native_wasm
installEmsdk: true
initScript: source ~/emsdk/emsdk_env.sh
postBuildSteps:
- task: PublishTestResults@2
displayName: Publish the WASM test results
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: 'output/logs/testlogs/**/*.xml'
testRunTitle: 'Linux WASM Tests'
publishArtifacts:
- name: testlogs_wasm
always: true
path: 'output/logs/testlogs'
# TODO: add tests for linux alpine
# TODO: add tests for linux no dependencies
# TODO: add tests for windows nano server
- job: coverage_reports # Coverage Reports
displayName: Coverage Reports
pool: ${{ parameters.buildAgentHost.pool }}
dependsOn:
- tests_netcore_windows
- tests_netcore_macos
- tests_netcore_linux
steps:
- checkout: self
- template: /scripts/azure-templates-variables.yml@self
- ${{ if ne(parameters.buildPipelineType, 'both') }}:
- template: /scripts/azure-templates-github-status.yml@self
parameters:
state: 'pending'
- task: DownloadBuildArtifacts@1
displayName: Download the coverage_netcore_windows artifact
inputs:
artifactName: coverage_netcore_windows
downloadPath: output
- task: DownloadBuildArtifacts@1
displayName: Download the coverage_netcore_macos artifact
inputs:
artifactName: coverage_netcore_macos
downloadPath: output
- task: DownloadBuildArtifacts@1
displayName: Download the coverage_netcore_linux artifact
inputs:
artifactName: coverage_netcore_linux
downloadPath: output
- task: PublishCodeCoverageResults@1
displayName: 'Publish the code coverage results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: 'output/**/Cobertura.xml'
- ${{ if ne(parameters.buildPipelineType, 'both') }}:
- template: /scripts/azure-templates-github-status.yml@self
- ${{ if ne(parameters.buildPipelineType, 'build') }}:
- stage: samples
displayName: Samples
${{ if eq(parameters.buildPipelineType, 'tests') }}:
dependsOn: prepare
${{ if eq(parameters.buildPipelineType, 'both') }}:
dependsOn: package
jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Samples (Windows)
parameters:
name: samples_windows
displayName: Windows
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentWindows}}
target: samples
requiredArtifacts:
- name: nuget
dir: nugets
postBuildSteps:
- pwsh: Remove-Item ./output/nugets/ -Recurse -Force -ErrorAction Continue
displayName: Delete the nugets folder
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Samples (macOS)
parameters:
name: samples_macos
displayName: macOS
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentMac }}
target: samples
installNinja: true
shouldPublish: false
requiredArtifacts:
- name: nuget
dir: nugets
preBuildSteps:
- template: /scripts/azure-templates-provisioning-profiles.yml@self
- template: /scripts/azure-templates-bootstrapper.yml@self # Build Samples (Linux)
parameters:
name: samples_linux
displayName: Linux
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgentLinux }}
packages: $(MANAGED_LINUX_PACKAGES)
target: samples
shouldPublish: false
requiredArtifacts:
- name: nuget
dir: nugets
installEmsdk: true
initScript: source ~/emsdk/emsdk_env.sh
- ${{ if eq(parameters.sdl.apiscan.enabled, 'true') }}:
- template: security/apiscan/v0.yml@xamarin-templates
parameters:
windowsPoolName: ${{ parameters.buildAgentHost.pool.name }}
windowsImageOverride: ${{ parameters.buildAgentHost.pool.image }}
timeoutInMinutes: 480
stageDependsOn:
- package
scanArtifacts:
- nuget
- nuget_symbols
- native_msvc
apiScanSoftwareName: 'SkiaSharp'
apiScanSoftwareVersionNum: $(SKIASHARP_MAJOR_VERSION)
apiScanPreserveLogsFolder: true
apiScanAuthConnectionString: 'runAs=App;AppId=$(ApiScanClientId)'
apiScanSurrogateConfigurationFolder: $(Build.ArtifactStagingDirectory)\APIScanSurrogates
preScanSteps:
- pwsh: |
$softwareFolder = "$(Build.ArtifactStagingDirectory)\binaries-to-scan"
$surrogateFile = "$(Build.SourcesDirectory)\scripts\guardian\APIScanSurrogates.in.xml"
$destFolder = "$(Build.ArtifactStagingDirectory)\APIScanSurrogates"
$destFile = "$destFolder\APIScanSurrogates.xml"
New-Item -ItemType Directory -Force -Path $destFolder | Out-Null
$surrogateContents = (Get-Content $surrogateFile)
$surrogateContents = $surrogateContents.Replace("{SOFTWARE_FOLDER}", $softwareFolder)
$surrogateContents | Set-Content $destFile
displayName: Generate the surrogate files
- pwsh: |
$nupkgs = (Get-ChildItem "$(Build.ArtifactStagingDirectory)\binaries-to-scan\*\*.*nupkg")
foreach ($nupkg in $nupkgs) {
$filename = $nupkg.Name.TrimEnd('.nupkg')
$dest = "$(Build.ArtifactStagingDirectory)\binaries-to-scan\nuget_symbols-extracted\$filename"
Write-Host "Extracting '$nupkg' to '$dest'..."
Expand-Archive $nupkg $dest
Remove-Item $nupkg
}
displayName: Extract all the .nupkg files
- ${{ if eq(parameters.buildPipelineType, 'tests') }}:
- stage: finalize
displayName: Finalize Build
dependsOn:
- api_diff
- managed
- samples
- tests
jobs:
- job: finalize # Finalize Build
displayName: Finalize Build
pool: ${{ parameters.buildAgentHost.pool }}
steps:
- checkout: none
- template: /scripts/azure-templates-variables.yml@self
- template: /scripts/azure-templates-github-status.yml@self
parameters:
context: 'SkiaSharp-Tests'
displayName: Update the final status for the tests pipeline