-
Notifications
You must be signed in to change notification settings - Fork 525
/
azure-pipelines-external-release.yml
194 lines (178 loc) · 6.67 KB
/
azure-pipelines-external-release.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
######################################
# NOTE: Before running this pipeline to generate a the GitHub Release and new nuget packages, update the VersionPrefix value in Version.props file
# NOTE: When Version.props file is modified, this pipeline will automatically get triggered
######################################
trigger:
branches:
include:
- main
paths:
include:
- Version.props
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
jobs:
- job: Phase_1
displayName: Assessment
cancelTimeoutInMinutes: 1
pool:
name: Azure Pipelines
steps:
- checkout: self
clean: False
submodules: recursive
persistCredentials: True
- task: PowerShell@2
displayName: 'Extract version number from Version.props'
inputs:
filePath: .azure/pipelines/extract_version.ps1
workingDirectory: .azure/pipelines
- task: UseDotNet@2
displayName: Use .NET Core sdk 6.0.x - needed for code signing
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Use .NET Core sdk 8.0.x
inputs:
version: 8.0.x
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
projects: '**/Garnet*.csproj'
arguments: -c Release
- task: PowerShell@2
displayName: 'Publish the GarnetServer binaries'
inputs:
filePath: .azure/pipelines/createbinaries.ps1
arguments: 1
workingDirectory: .azure/pipelines
- task: EsrpCodeSigning@5
displayName: Sign the binaries for nuget and zipped files
inputs:
ConnectedServiceName: 'GarnetCodeSigningOneCert'
AppRegistrationClientId: '19bbb452-ce7a-4b3d-bdc4-42a0090e797b'
AppRegistrationTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
AuthAKVName: 'GarnetCodeSignKV'
AuthCertName: 'Garnet-CodeSign-AuthCert'
AuthSignCertName: 'Garnet-CodeSigning-SigningCertificate'
FolderPath: .
Pattern: Garnet*.dll,Tsavorite*.dll,Garnet*.exe,HdrHistogram.dll,native_device.dll,*Lua.dll
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"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"
}
]
SessionTimeout: 20
VerboseLogin: true
- task: CmdLine@2
displayName: nuget pack Garnet Library
inputs:
workingDirectory: $(System.DefaultWorkingDirectory)
script: 'dotnet pack --no-build --no-restore --output $(Build.ArtifactStagingDirectory) -p:PackageVersion=$(Build.BuildNumber) /p:Configuration=Release libs/host/Garnet.host.csproj'
- task: CmdLine@2
displayName: nuget pack Garnet Server
inputs:
workingDirectory: $(System.DefaultWorkingDirectory)
script: 'dotnet pack --no-build --no-restore --output $(Build.ArtifactStagingDirectory) -p:PackageVersion=$(Build.BuildNumber) /p:Configuration=Release main/GarnetServer/GarnetServer.csproj'
- task: EsrpCodeSigning@5
displayName: Sign the NuGet Packages
inputs:
ConnectedServiceName: 'GarnetCodeSigningOneCert'
AppRegistrationClientId: '19bbb452-ce7a-4b3d-bdc4-42a0090e797b'
AppRegistrationTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
AuthAKVName: 'GarnetCodeSignKV'
AuthCertName: 'Garnet-CodeSign-AuthCert'
AuthSignCertName: 'Garnet-CodeSigning-SigningCertificate'
FolderPath: $(Build.ArtifactStagingDirectory)
Pattern: Microsoft.Garnet.*.nupkg, garnet-server.*.nupkg
signConfigType: inlineSignParams
inlineOperation: >-
[
{
"KeyCode" : "CP-401405",
"OperationCode" : "NuGetSign",
"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-401405",
"OperationCode" : "NuGetVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
SessionTimeout: 20
VerboseLogin: true
# Do after Nuget Pack so not part of Nuget Pack
- task: PowerShell@2
displayName: 'Zip the GarnetServer binaries'
inputs:
filePath: .azure/pipelines/createbinaries.ps1
arguments: 2
workingDirectory: .azure/pipelines
- task: CopyFiles@2
displayName: 'Copy Zipped Files to Artifacts dir: $(Build.artifactstagingdirectory)'
inputs:
Contents: '**'
SourceFolder: '$(Build.SourcesDirectory)/main/GarnetServer/bin/Release/net8.0/publish/output'
TargetFolder: $(build.artifactstagingdirectory)
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
- task: GitHubRelease@1
displayName: 'Create the GitHub release'
inputs:
action: 'create'
gitHubConnection: ADO_to_Github_ServiceConnection
tagSource: userSpecifiedTag
tag: 'v$(Build.BuildNumber)'
title: 'Garnet v$(Build.BuildNumber)'
releaseNotesSource: inline
releaseNotesInline: |
Get NuGet binaries at:
* https://www.nuget.org/packages/Microsoft.Garnet
More information at:
* https://microsoft.github.io/garnet
* https://github.com/microsoft/garnet
* https://www.microsoft.com/en-us/research/project/garnet
assets: |
$(Build.ArtifactStagingDirectory)/*.nupkg
$(Build.ArtifactStagingDirectory)/*.zip
$(Build.ArtifactStagingDirectory)/*.tar.xz
$(Build.ArtifactStagingDirectory)/*.7z
- task: NuGetCommand@2
displayName: 'Push both packages to NuGet.org'
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: GarnetADO_to_Nuget