Microsoft.Maui.Graphics/azure-pipelines.yml

184 строки
6.7 KiB
YAML

variables:
BuildVersion: $[counter('release-counter', 1)]
IsRunningOnCI: true
DotNet.Version: 6.0.100-rtm.21525.3
DotNet.Workloads: https://aka.ms/dotnet/maui/preview.10.json
DotNet.Cli.Telemetry.OptOut: true
parameters:
- name: BuildConfigurations
type: object
default:
- Debug
- Release
trigger:
branches:
include:
- main
- release/*
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
- release/*
paths:
include:
- '*'
exclude:
- .github/*
- docs/*
- CODE-OF-CONDUCT.md
- CONTRIBUTING.md
- LICENSE.TXT
- PATENTS.TXT
- README.md
- SECURITY.md
- THIRD-PARTY-NOTICES.TXT
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:
- stage: windows
displayName: Build Windows
jobs:
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
- job: win_hosted_${{ BuildConfiguration }}
workspace:
clean: all
displayName: Build Windows Phase (${{ BuildConfiguration }})
timeoutInMinutes: 60
pool:
vmImage: windows-2022
steps:
- task: NuGetToolInstaller@0
displayName: install new nuget
inputs:
versionSpec: '5.x'
- pwsh: |
echo "##vso[task.setvariable variable=DOTNET_ROOT]$env:ProgramFiles\dotnet"
displayName: set DOTNET_ROOT
errorActionPreference: stop
- pwsh: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -Version $(DotNet.Version) -InstallDir "$env:ProgramFiles\dotnet\" -Verbose
& dotnet --list-sdks
displayName: install .NET $(DotNet.Version)
errorActionPreference: stop
- pwsh: dotnet tool restore
displayName: install dotnet tools
- pwsh: |
dotnet vs install preview Enterprise +core +mobile +desktop +uwp --quiet
dotnet vs where
displayName: update vs
- pwsh: |
$uri = 'https://go.microsoft.com/fwlink/?linkid=2083338'
Invoke-WebRequest -Uri $uri -OutFile winsdksetup.exe
.\winsdksetup.exe /norestart /quiet | Out-Null
dir "C:\Program Files (x86)\Windows Kits\10\References\"
displayName: install Windows 10 SDK, version 1903 (10.0.18362.1)
- pwsh: echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
displayName: Select JDK 11
- pwsh: |
& dotnet workload install maui `
--from-rollback-file "$(DotNet.Workloads)" `
--source https://aka.ms/dotnet6/nuget/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-aspnetcore-7c57ecbd-3/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-4822e3c3-5/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-windowsdesktop-59fea7da-4/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-1ec2e17f-4/nuget/v3/index.json
displayName: install dotnet workloads
errorActionPreference: stop
- pwsh: |
Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1'
.\workload-install.ps1
displayName: install tizen
- pwsh: |
$vs = & dotnet vs where --preview --prop=InstallationPath
$msbuild = "$vs\MSBuild\Current\Bin\MSBuild.exe"
& $msbuild /r ./build/Build.Microsoft.Maui.Graphics.Windows.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}.binlog
displayName: build classic solutions
- pwsh: |
$vs = & dotnet vs where --preview --prop=InstallationPath
$msbuild = "$vs\MSBuild\Current\Bin\MSBuild.exe"
& $msbuild /r ./Microsoft.Maui.Graphics-net6.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}-net6.binlog
displayName: build net6 solutions
- task: NuGetCommand@2
displayName: 'Pack nupkg'
inputs:
command: 'pack'
packagesToPack: '**\Microsoft.Maui.*.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}'
configuration: ${{ BuildConfiguration }}
basePath: '$(System.DefaultWorkingDirectory)'
versioningScheme : 'byEnvVar'
versionEnvVar: 'BUILD_BUILDNUMBER'
- task: CopyFiles@2
displayName: 'Copy SignList.xml and Packages'
inputs:
Contents: |
**/SignList.xml
TargetFolder: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}'
flattenFolders: true
- task: PublishBuildArtifacts@1
condition: always()
displayName: publish artifacts
inputs:
ArtifactName: nuget
# only sign using the private server
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- stage: nuget_signing
dependsOn: windows
displayName: Sign Nuget
jobs:
- template: sign-artifacts/jobs/v2.yml@xamarin-templates
parameters:
signType: Real
teamName: Maui
usePipelineArtifactTasks: false
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
artifactPath: release
signedArtifactName: nuget
signedArtifactPath: signed
displayName: Sign Phase
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/') ))))