-
Notifications
You must be signed in to change notification settings - Fork 120
/
azure-pipelines-apidocs.yml
135 lines (131 loc) · 4.16 KB
/
azure-pipelines-apidocs.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
trigger:
branches:
include:
- main
paths:
include:
- apidocs
batch: true
pr:
branches:
include:
- main
paths:
include:
- apidocs
variables:
BuildConfiguration: Release
jobs:
- job: build_docs
displayName: Build API docs
pool:
vmImage: ubuntu-20.04
steps:
- checkout: self
clean: true
submodules: recursive
- task: UseDotNet@2
displayName: ⚙ Install .NET SDK
inputs:
packageType: sdk
useGlobalJson: true
# ESRP Authenticode sign package DLLs
- task: UseDotNet@2
displayName: ⚙ Install .NET Core 2.1.x
inputs:
packageType: runtime
version: 2.1.x
- powershell: dotnet tool update --global nbgv
displayName: ⚙ Install nbgv
- script: dotnet build -c $(BuildConfiguration)
displayName: 🏭 dotnet build
workingDirectory: apidocs
- task: EsrpCodeSigning@1
displayName: ✒ Assembly sign
inputs:
ConnectedServiceName: Xlang Code Signing
FolderPath: $(System.DefaultWorkingDirectory)/bin/$(BuildConfiguration)/netstandard2.0
Pattern: '*.dll'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: 60
MaxConcurrency: 50
MaxRetryAttempts: 5
condition: and(succeeded(), eq(variables['SignFiles'], 'true'), ne(variables['Build.Reason'], 'PullRequest'))
- script: dotnet pack Microsoft.Windows.SDK.Win32Docs --no-build -c $(BuildConfiguration) -p:BuildProjectReferences=false
displayName: 📦 dotnet pack
workingDirectory: apidocs
- task: EsrpCodeSigning@1
displayName: ✒ NuGet sign
inputs:
ConnectedServiceName: Xlang Code Signing
FolderPath: $(System.DefaultWorkingDirectory)/bin/Packages/$(BuildConfiguration)/NuGet
Pattern: '*.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"
}
]
SessionTimeout: 60
MaxConcurrency: 50
MaxRetryAttempts: 5
condition: and(succeeded(), eq(variables['SignFiles'], 'true'), ne(variables['Build.Reason'], 'PullRequest'))
- publish: bin/Packages/$(BuildConfiguration)/NuGet
artifact: ApiDocsNuGetPackages
displayName: 📢 Publish package
- publish: bin/$(BuildConfiguration)/netstandard2.0/documentationMappings.rsp
artifact: ApiDocsMetadata
displayName: 📢 Publish metadata
# # There's a problem on microsoft.visualstudio.com that requires the guid instead of NuGetCommand@2
# # Don't publish if we're using pre-generated source
# - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
# displayName: 📤 NuGet push
# inputs:
# command: push
# packagesToPush: $(System.DefaultWorkingDirectory)/bin/Packages/$(BuildConfiguration)/NuGet/*.nupkg
# publishVstsFeed: c1408dcb-1833-4ae4-9af5-1a891a12cc3c
# allowPackageConflicts: true
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))