-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Templates, maestro
- Loading branch information
Showing
11 changed files
with
1,180 additions
and
0 deletions.
There are no files selected for viewing
427 changes: 427 additions & 0 deletions
427
build/AzurePipelineTemplates/CsWinRT-BuildAndTest-Stage.yml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file is used as basis for the ADO pipeline | ||
name: $(MajorVersion).$(MinorVersion).$(PatchVersion)$(PrereleaseVersion).$(date:yyMMdd)$(rev:.r) | ||
|
||
stages: | ||
- template: CsWinRT-BuildAndTest-Stage.yml | ||
|
||
- template: CsWinRT-PublishToNuget-Stage.yml | ||
|
||
# if we are doing a release build, publish the build to Maestro | ||
- ${{ if eq( '$(PrereleaseVersion)', '') }}: | ||
template: CsWinRT-PublishToMaestro-Stage.yml |
49 changes: 49 additions & 0 deletions
49
build/AzurePipelineTemplates/CsWinRT-PublishToMaestro-Stage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
stages: | ||
- stage: PublishToMaestro | ||
displayName: Trigger Maestro Publish | ||
jobs: | ||
- job: TriggerMaestroPublish | ||
variables: | ||
_DotNetCoreRuntimeVersion: 5.0.11 # matches with SDK v. 5.0.402 | ||
_WindowsSdkPackageVersion: 10.0.18362.22 # matches with one consumed in WindowsAppSdk | ||
pool: | ||
vmImage: windows-2019 | ||
steps: | ||
|
||
# Parse Versions needed for offical CsWinRT version of build | ||
- task: CmdLine@2 | ||
displayName: Parse Versions | ||
inputs: | ||
workingDirectory: $(Build.SourcesDirectory) | ||
script: | | ||
rem Parse the build-generated Build.BuildNumber into components that | ||
rem can be recombined for version resources, nuget packages, etc. | ||
@echo off | ||
|
||
rem Encode the build date/rev into a 16 bit value for resource versions | ||
if "$(PrereleaseVersion)"=="" ( | ||
set RevisionBase=30000 | ||
) else ( | ||
set RevisionBase=0 | ||
) | ||
for /f "tokens=4,5 delims=." %%i in ("$(Build.BuildNumber)") do set BuildMetadata=%%i.%%j & set /a BuildRevision=%RevisionBase%+(((%%i/10000)-20)*366+((%%i)%%10000)/100*31+((%%i)%%100))*10+%%j | ||
|
||
set VersionNumber=$(MajorVersion).$(MinorVersion).$(PatchVersion).%BuildRevision% | ||
|
||
if "$(PrereleaseVersion)"=="" ( | ||
set NugetVersion=$(MajorVersion).$(MinorVersion).$(PatchVersion) | ||
) else ( | ||
set NugetVersion=$(Build.BuildNumber) | ||
) | ||
|
||
rem Export generated version numbers back for subsequent tasks | ||
echo ##vso[task.setvariable variable=BuildMetadata;]%BuildMetadata% | ||
echo ##vso[task.setvariable variable=BuildRevision;]%BuildRevision% | ||
echo ##vso[task.setvariable variable=VersionNumber;]%VersionNumber% | ||
echo ##vso[task.setvariable variable=NugetVersion;]%NugetVersion% | ||
|
||
- template: ..\..\eng\common\AzurePipelineTemplates\Maestro-PublishBuildToMaestro-Steps.yml | ||
parameters: | ||
AssetNames: Microsoft.Windows.CsWinRT;CsWinRT.Dependency.DotNetCoreSdk;CsWinRT.Dependency.DotNetCoreRuntime;CsWinRT.Dependency.WindowsSdkPackage | ||
AssetVersions: $(NugetVersion);$(Net5.Sdk.Version);$(_DotNetCoreRuntimeVersion);$(_WindowsSdkPackageVersion) |
261 changes: 261 additions & 0 deletions
261
build/AzurePipelineTemplates/CsWinRT-PublishToNuget-Stage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,261 @@ | ||
stages: | ||
- stage: Publish | ||
displayName: Publish To Internal Nuget Feed Stage | ||
jobs: | ||
- job: PublishTo_CsWinRT_InternalFeed | ||
pool: | ||
vmImage: windows-2019 | ||
steps: | ||
- checkout: self | ||
clean: True | ||
persistCredentials: True | ||
|
||
# Use NuGet 5.3 | ||
- task: NuGetToolInstaller@1 | ||
displayName: Use NuGet 5.3 | ||
continueOnError: True | ||
inputs: | ||
versionSpec: 5.3 | ||
|
||
# Component Detection | ||
- task: ComponentGovernanceComponentDetection@0 | ||
displayName: Component Detection | ||
|
||
# Download x86 | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: 'Download x86 ' | ||
inputs: | ||
artifactName: release_x86 | ||
itemPattern: '' | ||
downloadPath: $(Build.SourcesDirectory) | ||
extractTars: false | ||
|
||
# Download x64 | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download x64 | ||
inputs: | ||
artifactName: release_x64 | ||
itemPattern: '' | ||
downloadPath: $(Build.SourcesDirectory) | ||
extractTars: false | ||
|
||
# Download arm64 | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download arm64 | ||
inputs: | ||
artifactName: release_arm64 | ||
itemPattern: '' | ||
downloadPath: $(Build.SourcesDirectory) | ||
extractTars: false | ||
|
||
# Download NetStandard2.0 | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download NetStandard 2.0 | ||
inputs: | ||
artifactName: netstandard2.0 | ||
itemPattern: '' | ||
downloadPath: $(Build.SourcesDirectory) | ||
extractTars: false | ||
|
||
# Download Net5.0 | ||
- task: DownloadBuildArtifacts@0 | ||
displayName: 'Download Net5.0 ' | ||
inputs: | ||
artifactName: net5.0 | ||
itemPattern: '' | ||
downloadPath: $(Build.SourcesDirectory) | ||
extractTars: false | ||
|
||
# Stage Binaries | ||
- task: CmdLine@2 | ||
displayName: Stage Binaries | ||
inputs: | ||
workingDirectory: $(Build.SourcesDirectory) | ||
script: | | ||
copy release_x86\cswinrt.exe cswinrt.exe | ||
copy release_x86\WinRT.Interop.winmd WinRT.Interop.winmd | ||
# ESRP Codesigning | ||
- task: EsrpCodeSigning@1 | ||
displayName: ESRP CodeSigning | ||
inputs: | ||
ConnectedServiceName: 81cc6790-027c-4ef3-928d-65e8b96a691a | ||
FolderPath: $(Build.SourcesDirectory) | ||
Pattern: | | ||
cswinrt.exe | ||
WinRT.Interop.winmd | ||
netstandard2.0\WinRT.Runtime.dll | ||
netstandard2.0\WinRT.Host.Shim.dll | ||
netstandard2.0\WinRT.SourceGenerator.dll | ||
net5.0\WinRT.Runtime.dll | ||
net5.0\WinRT.Host.Shim.dll | ||
release_x64\WinRT.Host.dll | ||
release_x86\WinRT.Host.dll | ||
release_arm64\WinRT.Host.dll | ||
net5.0\IIDOptimizer\IIDOptimizer.exe | ||
net5.0\IIDOptimizer\IIDOptimizer.dll | ||
UseMinimatch: true | ||
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" | ||
} | ||
] | ||
# ESRP CodeSigning 3rd Party | ||
- task: EsrpCodeSigning@1 | ||
displayName: ESRP CodeSigning 3rd party | ||
continueOnError: True | ||
inputs: | ||
ConnectedServiceName: 81cc6790-027c-4ef3-928d-65e8b96a691a | ||
FolderPath: $(Build.SourcesDirectory) | ||
Pattern: | | ||
net5.0\IIDOptimizer\Mono.Cecil.dll | ||
net5.0\IIDOptimizer\Mono.Cecil.Mdb.dll | ||
net5.0\IIDOptimizer\Mono.Cecil.Pdb.dll | ||
net5.0\IIDOptimizer\Mono.Cecil.Rocks.dll | ||
UseMinimatch: true | ||
signConfigType: inlineSignParams | ||
inlineOperation: | | ||
[ | ||
{ | ||
"KeyCode" : "CP-231522", | ||
"OperationCode" : "SigntoolSign", | ||
"Parameters" : { | ||
"OpusName" : "Microsoft", | ||
"OpusInfo" : "http://www.microsoft.com", | ||
"Append" : "/as", | ||
"FileDigest" : "/fd \"SHA256\"", | ||
"PageHash" : "/NPH", | ||
"TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" | ||
}, | ||
"ToolName" : "sign", | ||
"ToolVersion" : "1.0" | ||
}, | ||
{ | ||
"KeyCode" : "CP-231522", | ||
"OperationCode" : "SigntoolVerify", | ||
"Parameters" : {}, | ||
"ToolName" : "sign", | ||
"ToolVersion" : "1.0" | ||
} | ||
] | ||
# Parse Versions | ||
- task: CmdLine@2 | ||
displayName: Parse Versions | ||
inputs: | ||
workingDirectory: $(Build.SourcesDirectory) | ||
script: | | ||
rem Parse the build-generated Build.BuildNumber into components that | ||
rem can be recombined for version resources, nuget packages, etc. | ||
@echo off | ||
|
||
rem Encode the build date/rev into a 16 bit value for resource versions | ||
if "$(PrereleaseVersion)"=="" ( | ||
set RevisionBase=30000 | ||
) else ( | ||
set RevisionBase=0 | ||
) | ||
for /f "tokens=4,5 delims=." %%i in ("$(Build.BuildNumber)") do set BuildMetadata=%%i.%%j & set /a BuildRevision=%RevisionBase%+(((%%i/10000)-20)*366+((%%i)%%10000)/100*31+((%%i)%%100))*10+%%j | ||
|
||
set VersionNumber=$(MajorVersion).$(MinorVersion).$(PatchVersion).%BuildRevision% | ||
|
||
if "$(PrereleaseVersion)"=="" ( | ||
set NugetVersion=$(MajorVersion).$(MinorVersion).$(PatchVersion) | ||
) else ( | ||
set NugetVersion=$(Build.BuildNumber) | ||
) | ||
|
||
rem Export generated version numbers back for subsequent tasks | ||
echo ##vso[task.setvariable variable=BuildMetadata;]%BuildMetadata% | ||
echo ##vso[task.setvariable variable=BuildRevision;]%BuildRevision% | ||
echo ##vso[task.setvariable variable=VersionNumber;]%VersionNumber% | ||
echo ##vso[task.setvariable variable=NugetVersion;]%NugetVersion% | ||
|
||
# NuGet Pack | ||
- task: NuGetCommand@2 | ||
displayName: NuGet pack | ||
inputs: | ||
command: pack | ||
searchPatternPack: nuget/Microsoft.Windows.CsWinRT.nuspec | ||
configurationToPack: Release | ||
buildProperties: cswinrt_nuget_version=$(NugetVersion);cswinrt_exe=$(Build.SourcesDirectory)\cswinrt.exe;interop_winmd=$(Build.SourcesDirectory)\WinRT.Interop.winmd;netstandard2_runtime=$(Build.SourcesDirectory)\netstandard2.0\WinRT.Runtime.dll;net5_runtime=$(Build.SourcesDirectory)\net5.0\WinRT.Runtime.dll;source_generator=$(Build.SourcesDirectory)\netstandard2.0\WinRT.SourceGenerator.dll;winrt_shim=$(Build.SourcesDirectory)\net5.0\WinRT.Host.Shim.dll;winrt_host_x86=$(Build.SourcesDirectory)\release_x86\WinRT.Host.dll;winrt_host_x64=$(Build.SourcesDirectory)\release_x64\WinRT.Host.dll;winrt_host_arm64=$(Build.SourcesDirectory)\release_arm64\WinRT.Host.dll;guid_patch=$(Build.SourcesDirectory)\net5.0\IIDOptimizer\*.* | ||
|
||
# ESRP CodeSigning | ||
- task: EsrpCodeSigning@1 | ||
displayName: ESRP CodeSigning | ||
inputs: | ||
ConnectedServiceName: 81cc6790-027c-4ef3-928d-65e8b96a691a | ||
FolderPath: $(Build.ArtifactStagingDirectory) | ||
Pattern: '*.nupkg' | ||
signConfigType: inlineSignParams | ||
inlineOperation: | | ||
[ | ||
{ | ||
"KeyCode" : "CP-401405", | ||
"OperationCode" : "NuGetSign", | ||
"Parameters" : {}, | ||
"ToolName" : "sign", | ||
"ToolVersion" : "1.0" | ||
}, | ||
{ | ||
"KeyCode" : "CP-401405", | ||
"OperationCode" : "NuGetVerify", | ||
"Parameters" : {}, | ||
"ToolName" : "sign", | ||
"ToolVersion" : "1.0" | ||
} | ||
] | ||
# NuGet push | ||
- task: NuGetCommand@2 | ||
displayName: NuGet push | ||
inputs: | ||
command: push | ||
searchPatternPush: $(Build.ArtifactStagingDirectory)/**/*.nupkg | ||
feedPublish: cfbb8a6b-97b7-4070-a6e8-a4081b046ae0 | ||
externalEndpoint: 80b1372e-52e9-486d-934f-92d5590c2241 | ||
|
||
# NuGet publish | ||
- task: PublishPipelineArtifact@1 | ||
displayName: NuGet publish | ||
inputs: | ||
path: $(Build.ArtifactStagingDirectory) | ||
artifactName: Publish | ||
|
||
# Publish Symbols | ||
- task: PublishSymbols@2 | ||
displayName: Publish Symbols | ||
inputs: | ||
SearchPattern: '**/*.pdb' | ||
IndexSources: false | ||
SymbolServerType: TeamServices | ||
SymbolsProduct: C#/WinRT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.