2020-08-15 02:22:14 +03:00
|
|
|
# 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
|
|
|
|
|
2020-11-11 04:17:23 +03:00
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
2020-08-16 20:43:48 +03:00
|
|
|
pr: none
|
2020-08-15 02:22:14 +03:00
|
|
|
|
|
|
|
pool:
|
2020-10-20 07:12:43 +03:00
|
|
|
name: Package ES Standard Build
|
2020-10-20 07:07:12 +03:00
|
|
|
demands:
|
|
|
|
- msbuild
|
|
|
|
- visualstudio
|
|
|
|
- visualstudio -equals C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
|
|
|
|
|
2020-08-16 20:43:48 +03:00
|
|
|
resources:
|
|
|
|
pipelines:
|
|
|
|
- pipeline: winsdk
|
|
|
|
source: WinSDK Nuget
|
2020-08-20 01:06:51 +03:00
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-08-16 20:43:48 +03:00
|
|
|
|
2020-08-15 02:22:14 +03:00
|
|
|
variables:
|
|
|
|
buildPlatform: 'x64'
|
|
|
|
buildConfiguration: 'Release'
|
2020-08-19 09:24:24 +03:00
|
|
|
System.Debug: true
|
2020-11-20 23:04:44 +03:00
|
|
|
IncludeCsProjection: false
|
2020-11-20 23:43:35 +03:00
|
|
|
UsePreGeneratedSource: true
|
|
|
|
WinMetadataSourceDir: $(Build.SourcesDirectory)\sources\Win32MetadataLib
|
2020-08-19 08:14:24 +03:00
|
|
|
OutputPackagesDir: $(Build.ArtifactStagingDirectory)\CreatedNugetPackages
|
2020-08-15 02:22:14 +03:00
|
|
|
|
|
|
|
steps:
|
2020-08-16 20:47:16 +03:00
|
|
|
- download: winsdk
|
2020-08-27 21:43:49 +03:00
|
|
|
displayName: Download pipeline NuGet packages
|
2020-08-16 20:58:41 +03:00
|
|
|
artifact: NuGetPackages
|
2020-11-21 00:15:53 +03:00
|
|
|
condition: eq(variables.UsePreGeneratedSource, false)
|
2020-08-16 20:47:16 +03:00
|
|
|
|
2020-08-15 03:55:24 +03:00
|
|
|
- task: UseDotNet@2
|
2020-08-27 21:43:49 +03:00
|
|
|
displayName: Use DotNet 3.x
|
2020-08-15 03:55:24 +03:00
|
|
|
inputs:
|
|
|
|
packageType: 'sdk'
|
2020-08-15 03:56:56 +03:00
|
|
|
version: '3.x'
|
2020-08-16 20:47:16 +03:00
|
|
|
|
2020-08-27 21:43:49 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Echo the pipeline variables
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
echo resources.pipeline.winsdk.pipelineID = $(resources.pipeline.winsdk.pipelineID)
|
2020-11-20 23:04:44 +03:00
|
|
|
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
|
2020-08-27 21:43:49 +03:00
|
|
|
|
2020-11-20 23:43:35 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Update job variables from incoming variables
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
echo '##vso[task.setvariable variable=WinMetadataSourceDir]$(Build.SourcesDirectory)\tests\TestScraperSource'
|
2020-11-21 00:04:14 +03:00
|
|
|
echo '##vso[task.setvariable variable=PrepOutput.NugetVersion]10.0.2000.0'
|
2020-11-20 23:43:35 +03:00
|
|
|
condition: eq(variables.UsePreGeneratedSource, true)
|
|
|
|
|
2020-08-18 03:47:12 +03:00
|
|
|
- task: PowerShell@2
|
2020-08-19 08:14:24 +03:00
|
|
|
displayName: Generate Win32 metadata C# source
|
2020-08-15 02:22:14 +03:00
|
|
|
inputs:
|
2020-08-18 03:47:12 +03:00
|
|
|
filePath: 'scripts\GenerateMetadataSource.ps1'
|
2020-10-26 12:22:46 +03:00
|
|
|
arguments: '-artifactsDir $(Agent.BuildDirectory)\winsdk -downloadDefaultCppNugets 0 -pipelineRunName $(resources.pipeline.winsdk.runName) -qfeOverride "$(QFEOverride)"'
|
2020-08-19 10:10:01 +03:00
|
|
|
errorActionPreference: 'continue'
|
2020-11-20 23:46:06 +03:00
|
|
|
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))
|
2020-08-18 03:47:12 +03:00
|
|
|
|
2020-08-18 21:45:33 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
2020-08-19 08:14:24 +03:00
|
|
|
displayName: Publish generator build artifacts
|
2020-08-18 21:45:33 +03:00
|
|
|
inputs:
|
|
|
|
PathtoPublish: '$(Agent.BuildDirectory)\winsdk\output'
|
|
|
|
ArtifactName: 'GeneratorOutput'
|
|
|
|
publishLocation: 'Container'
|
2020-11-20 23:46:06 +03:00
|
|
|
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))
|
2020-08-18 21:55:40 +03:00
|
|
|
|
2020-10-26 10:33:57 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: Publish generated .cs files
|
|
|
|
inputs:
|
2020-10-26 10:48:45 +03:00
|
|
|
PathtoPublish: 'sources\Win32MetadataLib\generated'
|
2020-10-26 10:33:57 +03:00
|
|
|
ArtifactName: GeneratedMetadataSource
|
|
|
|
publishLocation: 'Container'
|
2020-11-20 23:46:06 +03:00
|
|
|
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))
|
2020-10-26 10:33:57 +03:00
|
|
|
|
2020-08-19 08:14:24 +03:00
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: Build metadata binary
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\BuildMetadataBin.ps1'
|
2020-11-20 23:43:35 +03:00
|
|
|
arguments: '-assemblyVersion $(PrepOutput.NugetVersion) -metadataSourcePath $(WinMetadataSourceDir)'
|
2020-10-20 06:37:16 +03:00
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: Build csWin32 projected binary
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\BuildCsWin32Projection.ps1'
|
2020-11-20 23:08:12 +03:00
|
|
|
condition: and(succeeded(), eq(variables.IncludeCsProjection, true))
|
2020-10-20 06:37:16 +03:00
|
|
|
|
|
|
|
- task: PowerShell@2
|
2020-10-26 12:46:06 +03:00
|
|
|
displayName: Build C# samples that use C# Win32 projection
|
2020-10-20 06:37:16 +03:00
|
|
|
inputs:
|
2020-10-26 12:46:06 +03:00
|
|
|
filePath: 'scripts\BuildSamples.ps1'
|
2020-11-20 23:08:12 +03:00
|
|
|
condition: and(succeeded(), eq(variables.IncludeCsProjection, true))
|
2020-08-18 21:45:33 +03:00
|
|
|
|
2020-08-19 08:24:19 +03:00
|
|
|
# There's a problem on microsoft.visualstudio.com that requires the guid instead of NuGetCommand@2
|
|
|
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
2020-10-20 06:37:16 +03:00
|
|
|
displayName: Pack metadata nuget package
|
2020-08-19 08:14:24 +03:00
|
|
|
inputs:
|
|
|
|
command: 'pack'
|
|
|
|
packagesToPack: 'sources\nuget\Microsoft.Windows.SDK.Win32Metadata\Microsoft.Windows.SDK.Win32Metadata.nuspec'
|
|
|
|
packDestination: '$(OutputPackagesDir)'
|
|
|
|
versioningScheme: 'byEnvVar'
|
|
|
|
versionEnvVar: 'PrepOutput.NugetVersion'
|
2020-11-20 23:04:44 +03:00
|
|
|
basePath: '.'
|
2020-10-20 06:37:16 +03:00
|
|
|
|
2020-08-19 08:14:24 +03:00
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 'Publish NuGet packages to pipeline artifacts'
|
|
|
|
inputs:
|
|
|
|
targetPath: '$(OutputPackagesDir)'
|
|
|
|
artifact: NuGetPackages
|
2020-08-15 02:22:14 +03:00
|
|
|
|
2020-08-19 08:24:19 +03:00
|
|
|
# There's a problem on microsoft.visualstudio.com that requires the guid instead of NuGetCommand@2
|
2020-11-20 23:52:46 +03:00
|
|
|
# Don't publish if we're using pre-generated source
|
2020-08-19 08:24:19 +03:00
|
|
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
2020-08-19 08:14:24 +03:00
|
|
|
displayName: 'NuGet push'
|
|
|
|
inputs:
|
|
|
|
command: push
|
|
|
|
packagesToPush: '$(OutputPackagesDir)/**/*.nupkg;!$(OutputPackagesDir)/**/*.symbols.nupkg'
|
|
|
|
publishVstsFeed: 'c1408dcb-1833-4ae4-9af5-1a891a12cc3c'
|
|
|
|
allowPackageConflicts: true
|
2020-11-20 23:52:46 +03:00
|
|
|
condition: and(succeeded(), eq(variables.UsePreGeneratedSource, false))
|