forked from dotnet/docfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.yml
88 lines (76 loc) · 2.24 KB
/
publish.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
trigger: none
pool:
vmImage: windows-latest
variables:
- name: GH_RUNID
jobs:
- job: sign
pool:
vmImage: windows-latest
steps:
- checkout: none
- powershell: gh run download $env:GH_RUNID --repo dotnet/docfx -n nuget
displayName: Download GitHub artifact
env:
GH_TOKEN: $(GH_TOKEN)
GH_RUNID: $(GH_RUNID)
- task: AntiMalware@4
displayName: 'Run MpCmdRun.exe - CLI Executable'
inputs:
FileDirPath: '$(Build.SourcesDirectory)'
- task: EsrpCodeSigning@2
displayName: 'Sign NuGet packages'
inputs:
ConnectedServiceName: 'CodeSigning-APEX'
FolderPath: '$(Build.SourcesDirectory)'
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: $(Build.SourcesDirectory)
artifact: nuget
- job: publish
dependsOn: sign
pool:
vmImage: windows-latest
steps:
- checkout: none
- task: UseDotNet@2
inputs:
packageType: sdk
version: 6.x
- download: current
artifact: nuget
- powershell: |
dotnet nuget push $(Pipeline.Workspace)\nuget\Microsoft.DocAsCode.*.nupkg --api-key $env:NUGET_KEY --skip-duplicate --source https://nuget.org
dotnet nuget push $(Pipeline.Workspace)\nuget\docfx.*.nupkg --api-key $env:NUGET_KEY --skip-duplicate --source https://nuget.org
displayName: dotnet nuget push
env:
NUGET_KEY: $(NUGET_KEY)