System.Graphics/azure-pipelines.yml

181 строка
6.3 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:
- 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-07-09 16:42:11 +03:00
- pwsh: |
dotnet vs install preview Enterprise +core +mobile +desktop +uwp --quiet
dotnet vs where
2021-05-28 11:59:18 +03:00
displayName: update vs
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
- 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: |
2021-07-09 17:32:50 +03:00
$vs = & dotnet vs where --preview --prop=InstallationPath
2021-07-09 16:44:41 +03:00
$msbuild = "$vs\MSBuild\Current\Bin\MSBuild.exe"
2021-07-13 06:25:52 +03:00
& $msbuild /r ./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: |
$vs = & dotnet vs where --preview --prop=InstallationPath
$msbuild = "$vs\MSBuild\Current\Bin\MSBuild.exe"
2021-07-13 05:52:26 +03:00
& $msbuild /r ./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/') ))))