System.Graphics/azure-pipelines.yml

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

variables:
2021-05-27 20:10:19 +03:00
BuildVersion: $[counter('release-counter', 1)]
IsRunningOnCI: true
2021-07-09 16:53:53 +03:00
DotNet.Cli.Telemetry.OptOut: true
2021-03-26 23:09:23 +03:00
parameters:
- name: BuildConfigurations
type: object
default:
- Debug
- Release
trigger:
2021-03-26 13:25:46 +03:00
branches:
include:
- main
2021-06-21 12:23:47 +03:00
- release/*
2021-03-26 13:25:46 +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-08-31 01:38:08 +03:00
- release/*
2021-03-26 13:25:46 +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
2021-03-26 23:09:23 +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
2021-03-26 23:09:23 +03:00
stages:
- stage: windows
displayName: Build Windows
jobs:
2021-07-09 16:30:57 +03:00
- ${{ each BuildConfiguration in parameters.BuildConfigurations }}:
- job: win_hosted_${{ BuildConfiguration }}
2021-03-26 23:09:23 +03:00
workspace:
clean: all
2021-07-09 16:30:57 +03:00
displayName: Build Windows Phase (${{ BuildConfiguration }})
2021-03-26 23:09:23 +03:00
timeoutInMinutes: 60
pool:
2021-09-24 00:37:43 +03:00
vmImage: windows-2022
2021-03-26 23:09:23 +03:00
steps:
2022-01-06 03:54:02 +03:00
- template: eng/pipelines/common/provision.yml
2022-01-06 03:49:42 +03:00
parameters:
platform: 'windows'
- task: NuGetToolInstaller@0
displayName: install new nuget
inputs:
versionSpec: '5.x'
2021-09-24 00:37:43 +03:00
- pwsh: |
$DOTNET_ROOT = "$env:ProgramFiles\dotnet"
$env:DOTNET_ROOT = $DOTNET_ROOT
echo "##vso[task.setvariable variable=DOTNET_ROOT]$DOTNET_ROOT"
displayName: set up the .NET root envvar
2021-07-09 16:53:53 +03:00
errorActionPreference: stop
2021-07-09 16:30:57 +03:00
- pwsh: dotnet tool restore
2021-05-27 20:45:48 +03:00
displayName: install dotnet tools
2021-05-27 19:53:42 +03:00
2021-08-31 01:38:08 +03:00
- pwsh: echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
displayName: Select JDK 11
2021-07-09 16:46:36 +03:00
- pwsh: |
[xml] $fileXml = Get-Content "eng\Versions.props"
$DotNetVersion = $fileXml.SelectSingleNode("Project/PropertyGroup/MicrosoftDotnetSdkInternalPackageVersion").InnerText
echo "Installing .NET $DotNetVersion"
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -Version $DotNetVersion -InstallDir "$env:DOTNET_ROOT" -Verbose
& dotnet --list-sdks
displayName: install .NET
errorActionPreference: stop
2022-01-05 21:01:13 +03:00
#- pwsh: |
# rm $env:DOTNET_ROOT\metadata\workloads\6.0.200\installertype\msi
# displayName: don't use msi .net
# errorActionPreference: stop
- pwsh: |
dotnet build ./build/DotNet/DotNet.csproj -p:DotNetDirectory="$env:DOTNET_ROOT" -p:InstallDotNet=false
2021-09-24 00:37:43 +03:00
displayName: install dotnet workloads
2021-07-09 16:46:36 +03:00
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: |
$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)
2021-07-09 16:44:41 +03:00
- pwsh: |
$VS_ROOT = (& dotnet vs where --prop=InstallationPath)[0]
echo "##vso[task.setvariable variable=VS_ROOT]$VS_ROOT"
$MSBUILD_EXE = "$VS_ROOT\MSBuild\Current\Bin\MSBuild.exe"
echo "##vso[task.setvariable variable=MSBUILD_EXE]$MSBUILD_EXE"
echo "Using MSBuild: $MSBUILD_EXE"
displayName: set up the msbuild envvar
errorActionPreference: stop
- pwsh: |
& $env:MSBUILD_EXE /r /m ./build/Build.Microsoft.Maui.Graphics.Windows.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}.binlog
2021-07-13 05:55:35 +03:00
displayName: build classic solutions
2021-05-28 20:39:12 +03:00
2021-07-13 05:44:37 +03:00
- pwsh: |
& $env:MSBUILD_EXE /r /m ./Microsoft.Maui.Graphics-net6.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}-net6.binlog
2021-07-13 05:44:37 +03:00
displayName: build net6 solutions
2021-07-09 16:44:41 +03:00
2021-05-28 20:39:12 +03:00
- task: NuGetCommand@2
displayName: 'Pack nupkg'
inputs:
command: 'pack'
packagesToPack: '**\Microsoft.Maui.*.nuspec'
2021-07-09 16:30:57 +03:00
packDestination: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}'
configuration: ${{ BuildConfiguration }}
2021-05-28 20:39:12 +03:00
basePath: '$(System.DefaultWorkingDirectory)'
versioningScheme : 'byEnvVar'
versionEnvVar: 'BUILD_BUILDNUMBER'
2021-07-09 16:30:57 +03:00
2021-03-27 02:32:40 +03:00
- task: CopyFiles@2
2021-05-28 11:46:56 +03:00
displayName: 'Copy SignList.xml and Packages'
2021-03-27 02:32:40 +03:00
inputs:
2021-05-28 11:46:56 +03:00
Contents: |
**/SignList.xml
2021-07-09 16:30:57 +03:00
TargetFolder: '$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}'
2021-03-27 02:32:40 +03:00
flattenFolders: true
2021-03-18 20:38:53 +03:00
2021-03-26 23:09:23 +03:00
- task: PublishBuildArtifacts@1
condition: always()
displayName: publish artifacts
inputs:
ArtifactName: nuget
2021-03-18 20:38:53 +03:00
2021-07-09 16:30:57 +03:00
# only sign using the private server
2021-03-26 23:09:23 +03:00
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- stage: nuget_signing
2021-03-26 23:11:31 +03:00
dependsOn: windows
2021-03-26 23:09:23 +03:00
displayName: Sign Nuget
jobs:
- template: sign-artifacts/jobs/v2.yml@xamarin-templates
parameters:
signType: Real
2021-03-26 23:09:23 +03:00
teamName: Maui
usePipelineArtifactTasks: false
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
2021-03-27 01:49:56 +03:00
artifactPath: release
2021-03-26 23:09:23 +03:00
signedArtifactName: nuget
signedArtifactPath: signed
displayName: Sign Phase
2021-06-21 16:48:58 +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/') ))))