System.Graphics/azure-pipelines.yml

157 строки
5.4 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.Version: 6.0.100-preview.6.21355.2
DotNet.Cli.Telemetry.OptOut: true
2021-07-09 22:43:58 +03:00
MauiCheck.Version: 0.6.1
2021-07-09 16:44:41 +03:00
Maui.Version: --preview
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
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:
vmImage: windows-latest
steps:
2021-07-09 16:53:53 +03:00
- 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
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: |
2021-07-09 16:56:30 +03:00
# Update the installer installer
2021-07-09 17:32:50 +03:00
Invoke-WebRequest -UseBasicParsing -Uri "https://aka.ms/vs/install/latest/vs_setup.exe" -OutFile vs_setup.exe
2021-07-09 17:53:50 +03:00
& .\vs_setup.exe --update --quiet --wait | Out-Null
2021-07-09 16:53:53 +03:00
2021-07-09 16:42:11 +03:00
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-07-09 16:46:36 +03:00
- pwsh: |
& dotnet tool update --global redth.net.maui.check --version $(MauiCheck.Version) --add-source https://api.nuget.org/v3/index.json
2021-07-09 22:43:58 +03:00
& maui-check $(Maui.Version) --ci --non-interactive --fix --skip androidsdk --skip xcode --skip vswin --skip vsmac --skip edgewebview2
2021-07-09 16:46:36 +03:00
displayName: maui-check
errorActionPreference: stop
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 05:44:37 +03:00
& $msbuild /r ./Microsoft.Maui.Graphics.sln /p:Configuration=${{ BuildConfiguration }} /bl:$(Build.ArtifactStagingDirectory)/${{ BuildConfiguration }}.binlog
2021-05-28 20:39:12 +03:00
displayName: build net6 solutions
2021-07-13 05:44:37 +03:00
- 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 }}.binlog
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'
2021-05-31 17:22:13 +03:00
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/') ))))