206 строки
7.5 KiB
YAML
206 строки
7.5 KiB
YAML
variables:
|
|
BuildVersion: $[counter('release-counter', 1)]
|
|
IsRunningOnCI: true
|
|
DotNet.Cli.Telemetry.OptOut: true
|
|
provisioningVS: true
|
|
provisionator.path: '$(System.DefaultWorkingDirectory)/eng/provisioning/provisioning.csx'
|
|
provisionator.vs: '$(System.DefaultWorkingDirectory)/eng/provisioning/vs.csx'
|
|
provisionator.extraArguments: '--v'
|
|
|
|
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:
|
|
|
|
- template: /eng/pipelines/common/provision.yml
|
|
parameters:
|
|
platform: 'windows'
|
|
|
|
- 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: |
|
|
& dotnet vs where --prop=InstallationPath
|
|
displayName: list vs installs
|
|
|
|
- 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.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
|
|
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-orig.ps1
|
|
# We need this to install into the 6.0.200 band workload folder
|
|
$oldVer = '$DotnetVersionBand = "6.0.100"'
|
|
$newVer = '$DotnetVersionBand = "6.0.200"'
|
|
$wlcontent = Get-Content workload-install-orig.ps1
|
|
$wlcontent = $wlcontent.Replace($oldVer, $newVer)
|
|
Set-Content -Path .\workload-install.ps1 -Value $wlcontent
|
|
.\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: |
|
|
& 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe' /r /m ./build/Build.Microsoft.Maui.Graphics.Windows.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}.binlog
|
|
displayName: build classic solutions
|
|
|
|
- pwsh: |
|
|
# $VS_ROOT = (& dotnet vs where --prop=InstallationPath)[0]
|
|
$VS_ROOT = 'C:\Program Files\Microsoft Visual Studio\2022\Preview'
|
|
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 ./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/') ))))
|