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
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
jobs:
|
|
|
|
- job: job_calc_nuget_version
|
|
|
|
displayName: Calculate published NuGet version
|
2021-02-24 03:58:52 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
pool:
|
|
|
|
name: Package ES Standard Build
|
2021-02-24 03:58:52 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
variables:
|
|
|
|
System.Debug: true
|
|
|
|
OutputPackagesDir: $(Build.ArtifactStagingDirectory)\CreatedNugetPackages
|
|
|
|
Patch: $[counter(variables['DownloadNugetVersion'], 10)]
|
|
|
|
BuildNumberSuffix: $(Build.BuildNumber)
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: none
|
|
|
|
- task: PowerShell@2
|
|
|
|
name: echoVersion
|
|
|
|
displayName: Update PublishNugetVersion, set build number
|
|
|
|
inputs:
|
|
|
|
pwsh: true
|
|
|
|
targetType: 'inline'
|
|
|
|
script: |
|
|
|
|
$nugetVer = ${env:PublishNugetVersion}
|
|
|
|
if (!$nugetVer)
|
|
|
|
{
|
|
|
|
$downloadVer = "${env:DownloadNugetVersion}"
|
|
|
|
$parts = $downloadVer.Split(".")
|
|
|
|
$parts[3] = ${env:Patch}
|
|
|
|
$nugetVer = [string]::Join(".", $parts) + "-preview"
|
|
|
|
Write-Output "##vso[task.setvariable variable=PublishNugetVersion;isOutput=true;]$nugetVer"
|
|
|
|
}
|
2020-08-15 02:22:14 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
$verSuffix = ${env:BuildNumberSuffix}
|
|
|
|
Write-Host "##vso[build.updatebuildnumber]$($nugetVer)_$($verSuffix)"
|
|
|
|
- script: echo var = $(echoVersion.PublishNugetVersion)
|
|
|
|
displayName: Echo publish nuget version
|
|
|
|
- job: scrape_x64
|
|
|
|
displayName: "Scrape headers: x64"
|
|
|
|
pool:
|
|
|
|
name: Package ES Standard Build
|
|
|
|
demands:
|
|
|
|
- msbuild
|
|
|
|
- visualstudio
|
|
|
|
- visualstudio -equals C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
dependsOn: ['job_calc_nuget_version']
|
|
|
|
variables:
|
|
|
|
PublishNugetVersion: $[ dependencies.job_calc_nuget_version.outputs['echoVersion.PublishNugetVersion'] ]
|
2021-02-17 23:51:06 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
|
|
displayName: Use DotNet 3.x
|
|
|
|
inputs:
|
|
|
|
packageType: 'sdk'
|
|
|
|
version: '3.x'
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: GenerateMetadataSource.ps1 - x64
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\GenerateMetadataSource.ps1'
|
|
|
|
arguments: '-arch x64 -artifactsDir $(Agent.BuildDirectory)\winsdk -downloadDefaultCppNugets 0 -downloadNugetVersion $(DownloadNugetVersion) -publishNugetVersion $(PublishNugetVersion)'
|
|
|
|
errorActionPreference: 'continue'
|
|
|
|
pwsh: true
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: Scrape constants
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\BuildMetadataBin.ps1'
|
|
|
|
arguments: '-assemblyVersion $(PublishNugetVersion) -arch crossarch -SkipBinary'
|
|
|
|
pwsh: true
|
2020-08-16 20:47:16 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
- publish: 'generation\emitter\generated\x64'
|
|
|
|
artifact: 'x64'
|
2021-02-08 23:05:04 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
- job: scrape_x86
|
|
|
|
displayName: "Scrape headers: x86"
|
|
|
|
pool:
|
|
|
|
name: Package ES Standard Build
|
|
|
|
demands:
|
|
|
|
- msbuild
|
|
|
|
- visualstudio
|
|
|
|
- visualstudio -equals C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
dependsOn: ['job_calc_nuget_version']
|
|
|
|
variables:
|
|
|
|
PublishNugetVersion: $[ dependencies.job_calc_nuget_version.outputs['echoVersion.PublishNugetVersion']]
|
|
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
|
|
displayName: Use DotNet 3.x
|
|
|
|
inputs:
|
|
|
|
packageType: 'sdk'
|
|
|
|
version: '3.x'
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: GenerateMetadataSource.ps1 - x86
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\GenerateMetadataSource.ps1'
|
|
|
|
arguments: '-arch x86 -artifactsDir $(Agent.BuildDirectory)\winsdk -downloadDefaultCppNugets 0 -downloadNugetVersion $(DownloadNugetVersion) -publishNugetVersion $(PublishNugetVersion)'
|
|
|
|
errorActionPreference: 'continue'
|
|
|
|
pwsh: true
|
|
|
|
|
|
|
|
- publish: 'generation\emitter\generated\x86'
|
|
|
|
artifact: 'x86'
|
2020-08-16 20:47:16 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
- job: scrape_arm64
|
|
|
|
displayName: "Scrape headers: arm64"
|
|
|
|
pool:
|
|
|
|
name: Package ES Standard Build
|
|
|
|
demands:
|
|
|
|
- msbuild
|
|
|
|
- visualstudio
|
|
|
|
- visualstudio -equals C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
dependsOn: ['job_calc_nuget_version']
|
|
|
|
variables:
|
|
|
|
PublishNugetVersion: $[ dependencies.job_calc_nuget_version.outputs['echoVersion.PublishNugetVersion']]
|
|
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
|
|
displayName: Use DotNet 3.x
|
|
|
|
inputs:
|
|
|
|
packageType: 'sdk'
|
|
|
|
version: '3.x'
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: GenerateMetadataSource.ps1 - arm64
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\GenerateMetadataSource.ps1'
|
|
|
|
arguments: '-arch arm64 -artifactsDir $(Agent.BuildDirectory)\winsdk -downloadDefaultCppNugets 0 -downloadNugetVersion $(DownloadNugetVersion) -publishNugetVersion $(PublishNugetVersion)'
|
|
|
|
errorActionPreference: 'continue'
|
|
|
|
pwsh: true
|
|
|
|
|
|
|
|
- publish: 'generation\emitter\generated\arm64'
|
|
|
|
artifact: 'arm64'
|
2020-08-18 03:47:12 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
- job: build_winmd
|
|
|
|
displayName: Build, test, sign, package winmd
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
dependsOn: ['job_calc_nuget_version','scrape_x64','scrape_x86','scrape_arm64']
|
|
|
|
variables:
|
|
|
|
PublishNugetVersion: $[ dependencies.job_calc_nuget_version.outputs['echoVersion.PublishNugetVersion']]
|
|
|
|
pool:
|
|
|
|
name: Package ES Standard Build
|
|
|
|
demands:
|
|
|
|
- msbuild
|
|
|
|
- visualstudio
|
|
|
|
- visualstudio -equals C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
|
|
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
|
|
displayName: Use DotNet 3.x
|
|
|
|
inputs:
|
|
|
|
packageType: 'sdk'
|
|
|
|
version: '3.x'
|
2020-10-20 06:37:16 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
# ESRP Authenticode sign package DLLs
|
|
|
|
- task: UseDotNet@2
|
|
|
|
displayName: Install DotNet 2.1.x for signing tasks
|
|
|
|
inputs:
|
|
|
|
packageType: 'sdk'
|
|
|
|
version: '2.1.x'
|
2021-01-13 02:11:15 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
artifact: 'x64'
|
|
|
|
path: 'generation\emitter\generated\x64'
|
2021-01-20 11:55:33 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
artifact: 'x86'
|
|
|
|
path: 'generation\emitter\generated\x86'
|
2020-10-20 06:37:16 +03:00
|
|
|
|
2021-04-24 02:08:03 +03:00
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
artifact: 'arm64'
|
|
|
|
path: 'generation\emitter\generated\arm64'
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: Build metadata binary
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\BuildMetadataBin.ps1'
|
|
|
|
arguments: '-assemblyVersion $(PublishNugetVersion) -arch crossarch -SkipConstants'
|
|
|
|
pwsh: true
|
|
|
|
|
|
|
|
- publish: 'bin'
|
|
|
|
artifact: 'bin'
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
displayName: Test metadata binary
|
|
|
|
inputs:
|
|
|
|
filePath: 'scripts\TestWinmdBinary.ps1'
|
|
|
|
arguments: '-assemblyVersion $(PublishNugetVersion)'
|
|
|
|
pwsh: true
|
|
|
|
|
|
|
|
- task: EsrpCodeSigning@1
|
|
|
|
displayName: 'Authenticode Sign Packaged Dlls'
|
|
|
|
inputs:
|
|
|
|
ConnectedServiceName: 'Undocked RegFree Signing Connection'
|
|
|
|
FolderPath: '$(Build.SourcesDirectory)\bin'
|
|
|
|
Pattern: '*.dll,*.winmd'
|
|
|
|
signConfigType: 'inlineSignParams'
|
|
|
|
inlineOperation: |
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"keyCode": "CP-230012",
|
|
|
|
"operationSetCode": "SigntoolSign",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"parameterName": "OpusName",
|
|
|
|
"parameterValue": "Microsoft"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"parameterName": "OpusInfo",
|
|
|
|
"parameterValue": "http://www.microsoft.com"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"parameterName": "PageHash",
|
|
|
|
"parameterValue": "/NPH"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"parameterName": "FileDigest",
|
|
|
|
"parameterValue": "/fd sha256"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"parameterName": "TimeStamp",
|
|
|
|
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"toolName": "signtool.exe",
|
|
|
|
"toolVersion": "6.2.9304.0"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
SessionTimeout: '60'
|
|
|
|
MaxConcurrency: '50'
|
|
|
|
MaxRetryAttempts: '2'
|
|
|
|
condition: eq(variables['SignFiles'], '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: 'PublishNugetVersion'
|
|
|
|
basePath: '$(Build.SourcesDirectory)'
|
|
|
|
|
|
|
|
- task: EsrpCodeSigning@1
|
|
|
|
displayName: 'Sign NuGet Package'
|
|
|
|
inputs:
|
|
|
|
ConnectedServiceName: 'Undocked RegFree Signing Connection'
|
|
|
|
FolderPath: '$(OutputPackagesDir)'
|
|
|
|
Pattern: '*.nupkg'
|
|
|
|
signConfigType: 'inlineSignParams'
|
|
|
|
inlineOperation: |
|
|
|
|
[
|
|
|
|
{
|
2021-01-20 11:55:33 +03:00
|
|
|
"KeyCode" : "CP-401405",
|
2021-04-24 02:08:03 +03:00
|
|
|
"OperationCode" : "NuGetSign",
|
2021-01-20 11:55:33 +03:00
|
|
|
"Parameters" : {},
|
|
|
|
"ToolName" : "sign",
|
|
|
|
"ToolVersion" : "1.0"
|
2021-04-24 02:08:03 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"KeyCode" : "CP-401405",
|
|
|
|
"OperationCode" : "NuGetVerify",
|
|
|
|
"Parameters" : {},
|
|
|
|
"ToolName" : "sign",
|
|
|
|
"ToolVersion" : "1.0"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
SessionTimeout: '60'
|
|
|
|
MaxConcurrency: '50'
|
|
|
|
MaxRetryAttempts: '2'
|
|
|
|
condition: eq(variables['SignFiles'], 'true')
|
|
|
|
|
|
|
|
- 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
|