186 строки
6.5 KiB
YAML
186 строки
6.5 KiB
YAML
variables:
|
|
BuildVersion: $[counter('release-counter', 1)]
|
|
IsRunningOnCI: true
|
|
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: |
|
|
$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
|
|
errorActionPreference: stop
|
|
|
|
- pwsh: dotnet tool restore
|
|
displayName: install dotnet tools
|
|
|
|
- pwsh: echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
|
|
displayName: Select JDK 11
|
|
|
|
- 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: |
|
|
rm $env:DOTNET_ROOT\metadata\workloads\6.0.100\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
|
|
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: |
|
|
$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: |
|
|
$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
|
|
displayName: build classic solutions
|
|
|
|
- pwsh: |
|
|
& $env:MSBUILD_EXE /r /m ./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/') ))))
|