win32metadata/azure-pipelines.yml

140 строки
5.1 KiB
YAML

# Universal Windows Platform
# Build a Universal Windows Platform project using Visual Studio.
# Add steps that test and distribute an app, save build artifacts, and more:
# https://aka.ms/yaml
trigger:
branches:
include:
- master
pr: none
pool:
name: Package ES Standard Build
demands:
- msbuild
- visualstudio
- visualstudio -equals C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
resources:
pipelines:
- pipeline: winsdk
source: WinSDK Nuget
trigger:
branches:
- master
variables:
buildPlatform: 'x64'
buildConfiguration: 'Release'
System.Debug: true
IncludeCsProjection: false
UsePreGeneratedSource: true
WinMetadataSourceDir: $(Build.SourcesDirectory)\sources\Win32MetadataLib
OutputPackagesDir: $(Build.ArtifactStagingDirectory)\CreatedNugetPackages
steps:
- download: winsdk
displayName: Download pipeline NuGet packages
artifact: NuGetPackages
condition: eq(variables.UsePreGeneratedSource, false)
- task: UseDotNet@2
displayName: Use DotNet 3.x
inputs:
packageType: 'sdk'
version: '3.x'
- task: CmdLine@2
displayName: Echo the pipeline variables
inputs:
script: |
echo resources.pipeline.winsdk.pipelineID = $(resources.pipeline.winsdk.pipelineID)
echo resources.pipeline.winsdk.runName = $(resources.pipeline.winsdk.runName)
echo resources.pipeline.winsdk.runID = $(resources.pipeline.winsdk.runID)
echo resources.pipeline.winsdk.runURI = $(resources.pipeline.winsdk.runURI)
echo resources.pipeline.winsdk.sourceBranch = $(resources.pipeline.winsdk.sourceBranch)
echo resources.pipeline.winsdk.sourceCommit = $(resources.pipeline.winsdk.sourceCommit)
echo resources.pipeline.winsdk.sourceProvider = $(resources.pipeline.winsdk.sourceProvider)
echo resources.pipeline.winsdk.requestedFor = $(resources.pipeline.winsdk.requestedFor)
echo resources.pipeline.winsdk.requestedForID = $(resources.pipeline.winsdk.requestedForID)
dir /s $(Agent.BuildDirectory)\winsdk\NuGetPackages
- task: CmdLine@2
displayName: Update job variables from incoming variables
inputs:
script: |
echo '##vso[task.setvariable variable=WinMetadataSourceDir]$(Build.SourcesDirectory)\tests\TestScraperSource'
echo '##vso[task.setvariable variable=PrepOutput.NugetVersion]10.0.2000.0'
condition: eq(variables.UsePreGeneratedSource, true)
- task: PowerShell@2
displayName: Generate Win32 metadata C# source
inputs:
filePath: 'scripts\GenerateMetadataSource.ps1'
arguments: '-artifactsDir $(Agent.BuildDirectory)\winsdk -downloadDefaultCppNugets 0 -pipelineRunName $(resources.pipeline.winsdk.runName) -qfeOverride "$(QFEOverride)"'
errorActionPreference: 'continue'
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))
- task: PublishBuildArtifacts@1
displayName: Publish generator build artifacts
inputs:
PathtoPublish: '$(Agent.BuildDirectory)\winsdk\output'
ArtifactName: 'GeneratorOutput'
publishLocation: 'Container'
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))
- task: PublishBuildArtifacts@1
displayName: Publish generated .cs files
inputs:
PathtoPublish: 'sources\Win32MetadataLib\generated'
ArtifactName: GeneratedMetadataSource
publishLocation: 'Container'
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))
- task: PowerShell@2
displayName: Build metadata binary
inputs:
filePath: 'scripts\BuildMetadataBin.ps1'
arguments: '-assemblyVersion $(PrepOutput.NugetVersion) -metadataSourcePath $(WinMetadataSourceDir)'
- task: PowerShell@2
displayName: Build csWin32 projected binary
inputs:
filePath: 'scripts\BuildCsWin32Projection.ps1'
condition: and(succeeded(), eq(variables.IncludeCsProjection, true))
- task: PowerShell@2
displayName: Build C# samples that use C# Win32 projection
inputs:
filePath: 'scripts\BuildSamples.ps1'
condition: and(succeeded(), eq(variables.IncludeCsProjection, true))
# There's a problem on microsoft.visualstudio.com that requires the guid instead of NuGetCommand@2
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: Pack metadata nuget package
inputs:
command: 'pack'
packagesToPack: 'sources\nuget\Microsoft.Windows.SDK.Win32Metadata\Microsoft.Windows.SDK.Win32Metadata.nuspec'
packDestination: '$(OutputPackagesDir)'
versioningScheme: 'byEnvVar'
versionEnvVar: 'PrepOutput.NugetVersion'
basePath: '.'
- task: PublishPipelineArtifact@1
displayName: 'Publish NuGet packages to pipeline artifacts'
inputs:
targetPath: '$(OutputPackagesDir)'
artifact: NuGetPackages
# There's a problem on microsoft.visualstudio.com that requires the guid instead of NuGetCommand@2
# Don't publish if we're using pre-generated source
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(OutputPackagesDir)/**/*.nupkg;!$(OutputPackagesDir)/**/*.symbols.nupkg'
publishVstsFeed: 'c1408dcb-1833-4ae4-9af5-1a891a12cc3c'
allowPackageConflicts: true
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))