mirror of https://github.com/dapr/dotnet-sdk.git
187 lines
7.0 KiB
YAML
187 lines
7.0 KiB
YAML
# dapr/dotnet-sdk pipeline
|
|
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- master
|
|
tags:
|
|
include:
|
|
- v*
|
|
|
|
stages:
|
|
- stage: Build
|
|
jobs:
|
|
- job: 'build_projects'
|
|
pool:
|
|
vmImage: 'windows-2019'
|
|
strategy:
|
|
maxParallel: 2
|
|
matrix:
|
|
debug:
|
|
configuration: debug
|
|
release:
|
|
configuration: release
|
|
steps:
|
|
- task: UseDotNet@2
|
|
displayName: 'Install dotnet SDK 3.0'
|
|
inputs:
|
|
packageType: sdk
|
|
version: 3.0.100
|
|
installationPath: $(Agent.ToolsDirectory)/dotnet
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Build solution - $(Configuration)'
|
|
inputs:
|
|
command: 'build'
|
|
arguments: '--configuration $(Configuration)'
|
|
projects: 'code.sln'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Test - $(Configuration)'
|
|
inputs:
|
|
command: 'test'
|
|
arguments: '--configuration $(Configuration)'
|
|
projects: 'code.sln'
|
|
# ESRP Code Signing does not work with dotnet core 3.0
|
|
- task: UseDotNet@2
|
|
displayName: 'Install dotnet SDK 2.0 for ESRP'
|
|
inputs:
|
|
packageType: sdk
|
|
version: 2.0.x
|
|
installationPath: $(Agent.ToolsDirectory)/dotnet
|
|
- task: EsrpCodeSigning@1
|
|
displayName: 'ESRP Authenticode CodeSign'
|
|
condition: and(eq(variables['Configuration'], 'release'), or(contains(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
|
inputs:
|
|
ConnectedServiceName: 'ActionsSigning'
|
|
FolderPath: 'bin/$(Configuration)'
|
|
Pattern: 'Microsoft.Dapr*.dll'
|
|
UseMinimatch: true
|
|
signConfigType: 'inlineSignParams'
|
|
inlineOperation: |
|
|
[
|
|
{
|
|
"keyCode": "$(ESRP_AUTHENTICODE_SIGN)",
|
|
"operationSetCode": "SigntoolSign",
|
|
"parameters": [{
|
|
"parameterName": "OpusName",
|
|
"parameterValue": "Microsoft"
|
|
},
|
|
{
|
|
"parameterName": "OpusInfo",
|
|
"parameterValue": "http://www.microsoft.com"
|
|
},
|
|
{
|
|
"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": "$(ESRP_AUTHENTICODE_SIGN)",
|
|
"operationSetCode": "SigntoolVerify",
|
|
"parameters": [],
|
|
"toolName": "sign",
|
|
"toolVersion": "1.0"
|
|
}
|
|
]
|
|
SessionTimeout: '20'
|
|
MaxConcurrency: '50'
|
|
MaxRetryAttempts: '5'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Package Microsoft.Dapr.Actors nuget - $(Configuration)'
|
|
inputs:
|
|
command: 'pack'
|
|
arguments: '--configuration $(Configuration)'
|
|
packagesToPack: 'src/Microsoft.Dapr.Actors/Microsoft.Dapr.Actors.csproj'
|
|
nobuild: true
|
|
versioningScheme: 'off'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Package Microsoft.Dapr.Actors.AspNetCore nuget - $(Configuration)'
|
|
inputs:
|
|
command: 'pack'
|
|
arguments: '--configuration $(Configuration)'
|
|
packagesToPack: 'src/Microsoft.Dapr.Actors.AspNetCore/Microsoft.Dapr.Actors.AspNetCore.csproj'
|
|
nobuild: true
|
|
versioningScheme: 'off'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Package Microsoft.Dapr.Client nuget - $(Configuration)'
|
|
inputs:
|
|
command: 'pack'
|
|
arguments: '--configuration $(Configuration)'
|
|
packagesToPack: 'src/Microsoft.Dapr.Client/Microsoft.Dapr.Client.csproj'
|
|
nobuild: true
|
|
versioningScheme: 'off'
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Package Microsoft.Dapr.AspNetCore nuget - $(Configuration)'
|
|
inputs:
|
|
command: 'pack'
|
|
arguments: '--configuration $(Configuration)'
|
|
packagesToPack: 'src/Microsoft.Dapr.AspNetCore/Microsoft.Dapr.AspNetCore.csproj'
|
|
nobuild: true
|
|
versioningScheme: 'off'
|
|
- task: EsrpCodeSigning@1
|
|
displayName: 'ESRP CodeSign - Nuget Package'
|
|
condition: and(eq(variables['Configuration'], 'release'), or(contains(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
|
|
inputs:
|
|
ConnectedServiceName: 'ActionsSigning'
|
|
FolderPath: '$(Build.ArtifactStagingDirectory)'
|
|
Pattern: 'Microsoft.Dapr*.nupkg'
|
|
UseMinimatch: true
|
|
signConfigType: 'inlineSignParams'
|
|
inlineOperation: |
|
|
[
|
|
{
|
|
"keyCode": "$(ESRP_CODESIGN_NUPKG)",
|
|
"operationSetCode": "NuGetSign",
|
|
"parameters": [ ],
|
|
"toolName": "sign",
|
|
"toolVersion": "1.0"
|
|
},
|
|
{
|
|
"keyCode": "$(ESRP_CODESIGN_NUPKG)",
|
|
"operationSetCode": "NuGetVerify",
|
|
"parameters": [ ],
|
|
"toolName": "sign",
|
|
"toolVersion": "1.0"
|
|
}
|
|
]
|
|
SessionTimeout: '20'
|
|
MaxConcurrency: '50'
|
|
MaxRetryAttempts: '5'
|
|
- task: CopyFiles@2
|
|
condition: ne(variables['Build.Reason'], 'PullRequest')
|
|
inputs:
|
|
SourceFolder: 'bin/$(Configuration)'
|
|
Contents: '**'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
- task: NuGetCommand@2
|
|
displayName: 'Publish nuget package to feed'
|
|
condition: false
|
|
inputs:
|
|
command: 'push'
|
|
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
|
|
nuGetFeedType: 'internal'
|
|
publishVstsFeed: 'b3bbc81a-4160-49ac-9a5f-5a27eda7ce5b'
|
|
allowPackageConflicts: true
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish binaries to artifact'
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
ArtifactName: '$(Configuration)_drop'
|
|
publishLocation: 'Container'
|
|
- task: CmdLine@2
|
|
displayName: 'Add release tag for release branch'
|
|
condition: and(eq(variables['Configuration'], 'release'), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
|
|
inputs:
|
|
script: 'echo "##vso[build.addbuildtag]release'
|
|
workingDirectory: '$(Build.ArtifactStagingDirectory)'
|