azure-functions-vs-build-sdk/azure-pipelines.yml

168 строки
5.5 KiB
YAML

name: $(Build.SourceBranchName)_$(Build.Reason)_$(BuildNumber)
trigger:
- v4.x
- release/4
pool:
vmImage: 'windows-2019'
variables:
BuildNumber: $[counter(format(''), 289)]
${{ if contains( variables['Build.SourceBranch'], 'release/4' ) }}:
UseSuffix: false
steps:
- task: PowerShell@2
displayName: 'Install .NET 6'
inputs:
targetType: 'inline'
script: |
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
# Official release versions can be found at: https://dotnet.microsoft.com/download/dotnet/6.0
# Newer versions can be found at: https://github.com/dotnet/installer#installers-and-binaries
./dotnet-install.ps1 -InstallDir 'C:\Program Files\dotnet' -Verbose -Version 6.0.101
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: 'build'
arguments: -c Release
projects: |
src\**\Microsoft.NET.Sdk.Functions.MSBuild.csproj
src\**\Microsoft.NET.Sdk.Functions.Generator.csproj
src\**\Microsoft.NET.Sdk.Functions.csproj
- task: DotNetCoreCLI@2
displayName: 'Unit Tests'
inputs:
command: 'test'
projects: |
test\**\Microsoft.NET.Sdk.Functions.Generator.Tests.csproj
test\**\Microsoft.NET.Sdk.Functions.MSBuild.Tests.csproj
test\**\Microsoft.NET.Sdk.Functions.EndToEnd.Tests.csproj
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'ESRP Service'
UseMinimatch: true
FolderPath: 'src\'
Pattern: |
Microsoft.NET.Sdk.Functions.MSBuild\bin\Release\*\Microsoft.NET.Sdk.Functions.MSBuild.dll
Microsoft.NET.Sdk.Functions.Generator\bin\Release\*\Microsoft.NET.Sdk.Functions.Generator.dll
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode" : "CP-233863-SN",
"OperationCode" : "StrongNameSign",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-233863-SN",
"OperationCode" : "StrongNameVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
displayName: 'ESRP CodeSigning: Third party'
inputs:
ConnectedServiceName: 'ESRP Service'
UseMinimatch: true
FolderPath: 'src\'
Pattern: |
Microsoft.NET.Sdk.Functions.Generator\bin\Release\**\Newtonsoft.Json.dll
Microsoft.NET.Sdk.Functions.Generator\bin\Release\**\Mono.Cecil.dll
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"
}
]
- task: DotNetCoreCLI@2
displayName: 'Pack Microsoft.Net.Sdk.Functions package'
inputs:
command: 'custom'
custom: 'pack'
arguments: '--no-build -c Release -o artifacts'
projects: |
**\Microsoft.Net.Sdk.Functions.csproj
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
displayName: 'ESRP CodeSigning: Nupkg'
inputs:
ConnectedServiceName: 'ESRP Service'
FolderPath: 'artifacts'
Pattern: 'Microsoft.Net.Sdk.Functions*.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"
}
]
- task: DotNetCoreCLI@2
displayName: 'Run End to End tests'
inputs:
command: 'test'
projects: '.\FunctionsSdkE2ETests\FunctionsSdkE2ETests.sln'
arguments: '-v n'
- pwsh: |
Move-Item -Path '$(Build.Repository.LocalPath)\artifacts\Microsoft.NET.Sdk.Functions.*' -Destination '$(Build.ArtifactStagingDirectory)'
displayName: 'Move artifacts'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'