# 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 OutputPackagesDir: $(Build.ArtifactStagingDirectory)\CreatedNugetPackages steps: - download: winsdk displayName: Download pipeline NuGet packages artifact: NuGetPackages - 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: 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' - task: PublishBuildArtifacts@1 displayName: Publish generator build artifacts inputs: PathtoPublish: '$(Agent.BuildDirectory)\winsdk\output' ArtifactName: 'GeneratorOutput' publishLocation: 'Container' - task: PublishBuildArtifacts@1 displayName: Publish generated .cs files inputs: PathtoPublish: 'sources\Win32MetadataLib\generated' ArtifactName: GeneratedMetadataSource publishLocation: 'Container' - task: PowerShell@2 displayName: Build metadata binary inputs: filePath: 'scripts\BuildMetadataBin.ps1' - task: PowerShell@2 displayName: Build csWin32 projected binary inputs: filePath: 'scripts\BuildCsWin32Projection.ps1' - task: PowerShell@2 displayName: Build C# samples that use C# Win32 projection inputs: filePath: 'scripts\BuildSamples.ps1' # 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: 'sources' # 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 CsWin32 nuget package inputs: command: 'pack' packagesToPack: 'sources\nuget\Microsoft.Windows.SDK.Win32\Microsoft.Windows.SDK.Win32.nuspec' packDestination: '$(OutputPackagesDir)' versioningScheme: 'byEnvVar' versionEnvVar: 'PrepOutput.NugetVersion' basePath: 'sources' - 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 - 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