Forge/azure-pipelines.yml

129 строки
3.6 KiB
YAML

trigger:
- master
pool:
vmImage: 'windows-latest'
timeoutInMinutes: 10
steps:
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Build.SourcesDirectory)\Forge.sln'
- task: VSBuild@1
displayName: 'Build .NET sln for tests'
inputs:
solution: '$(Build.SourcesDirectory)\Forge.sln'
platform: 'Any CPU'
configuration: Release
- task: VSTest@2
displayName: 'Run Tests'
inputs:
testAssemblyVer2: |
$(Build.SourcesDirectory)\Forge.TreeWalker.UnitTests\obj\Release\Microsoft.Forge.TreeWalker.UnitTests.dll
runInParallel: True
- task: VSBuild@1
displayName: 'Build .NET sln and pack'
inputs:
solution: '$(Build.SourcesDirectory)\Forge.sln'
platform: 'Any CPU'
configuration: Release
msbuildArgs: '-t:pack'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.0.100'
- task: UseDotNet@2
inputs:
packageType: 'runtime'
version: '2.1.23'
- task: EsrpCodeSigning@1
displayName: 'ESRP CodeSigning - Authenticode'
inputs:
ConnectedServiceName: 'Forge ESRP CodeSign2'
FolderPath: '$(Build.SourcesDirectory)\Forge.TreeWalker\bin\Release'
Pattern: 'Microsoft.Forge.TreeWalker.dll'
signConfigType: 'inlineSignParams'
OpusName: 'Microsoft Forge TreeWalker'
OpusInfo: 'https://www.github.com/microsoft/forge'
inlineOperation: |
[ {
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "Append",
"parameterValue": "/as"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}]
- task: EsrpCodeSigning@1
displayName: 'ESRP CodeSigning - NuGet'
inputs:
ConnectedServiceName: 'Forge ESRP CodeSign2'
FolderPath: '$(Build.SourcesDirectory)\Forge.TreeWalker\bin\Release'
Pattern: 'Microsoft.Forge.TreeWalker*.symbols.nupkg'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
- task: NuGetCommand@2
displayName: 'NuGet push AzureArtifacts'
inputs:
command: push
packagesToPush: '$(Build.SourcesDirectory)\Forge.TreeWalker\bin\Release\Microsoft.Forge.TreeWalker*.symbols.nupkg'
publishVstsFeed: 'ForgeArtifacts'
allowPackageConflicts: true