-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathazure-pipelines.yml
74 lines (66 loc) · 1.99 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
trigger:
tags:
include:
- 'v*'
variables:
- group: docfx-v2-pipeline-kv
jobs:
- job: publish
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
inputs:
packageType: sdk
version: 6.0.x
- task: UseDotNet@2
inputs:
packageType: sdk
version: 2.1.x # for ESRPCodeSigning
- powershell: ./build.ps1
displayName: dotnet test
- powershell: |
$version = "$(Build.SourceBranchName)".substring(1)
dotnet pack -c Release -o $(Agent.TempDirectory)/nuget /p:Version=$version /p:InformationalVersion=$version-$(Build.SourceVersion)
displayName: dotnet pack
- task: EsrpCodeSigning@1
displayName: 'Sign NuGet packages'
inputs:
ConnectedServiceName: 'CodeSigning-APEX'
FolderPath: '$(Agent.TempDirectory)/nuget'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
SessionTimeout: 20
inlineOperation: |
[
{
"KeyCode" : "CP-401405",
"OperationSetCode" : "NuGetSign",
"Parameters" : [
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
}
],
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-401405",
"OperationSetCode" : "NuGetVerify",
"Parameters" : [],
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
- publish: $(Agent.TempDirectory)/nuget
artifact: nuget
- powershell: dotnet nuget push $(Agent.TempDirectory)\nuget\*.nupkg --api-key $env:NUGETAPIKEY --source https://nuget.org
displayName: dotnet nuget push
env:
NUGETAPIKEY: $(NugetAPIKey)