@@ -5,13 +5,15 @@ name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
5
5
trigger :
6
6
branches :
7
7
include :
8
- - master
9
- - vnext
8
+ - main
9
+ - dev
10
+ - support/v1
10
11
pr :
11
12
branches :
12
13
include :
13
- - master
14
- - vnext
14
+ - main
15
+ - dev
16
+ - support/v1
15
17
variables :
16
18
buildPlatform : ' Any CPU'
17
19
buildConfiguration : ' Release'
@@ -41,10 +43,6 @@ extends:
41
43
displayName : ' Publish Artifact: Nugets'
42
44
artifactName : Nugets
43
45
targetPath : ' $(Build.ArtifactStagingDirectory)/Nugets'
44
- - output : pipelineArtifact
45
- displayName : ' Publish Artifact: Hidi'
46
- artifactName : Microsoft.OpenApi.Hidi-v$(hidiversion)
47
- targetPath : ' $(Build.ArtifactStagingDirectory)/Microsoft.OpenApi.Hidi-v$(hidiversion)'
48
46
steps :
49
47
- task : UseDotNet@2
50
48
displayName : ' Use .NET 6'
@@ -177,23 +175,13 @@ extends:
177
175
MaxConcurrency : ' 50'
178
176
MaxRetryAttempts : ' 5'
179
177
PendingAnalysisWaitTimeoutMinutes : ' 5'
180
-
181
- - task : PowerShell@2
182
- displayName : " Get Hidi's version-number from .csproj"
183
- inputs :
184
- targetType : ' inline'
185
- script : |
186
- $xml = [Xml] (Get-Content .\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj)
187
- $version = $xml.Project.PropertyGroup.Version
188
- echo $version
189
- echo "##vso[task.setvariable variable=hidiversion]$version"
190
-
178
+
191
179
# publish hidi as an .exe
192
180
- task : DotNetCoreCLI@2
193
181
displayName : publish Hidi as executable
194
182
inputs :
195
183
command : ' publish'
196
- arguments : -c Release --runtime win-x64 /p:PublishSingleFile=true /p:PackAsTool=false --self-contained --output $(Build.ArtifactStagingDirectory)/Microsoft.OpenApi.Hidi-v$(hidiversion)
184
+ arguments : -c Release --runtime win-x64 /p:PublishSingleFile=true /p:PackAsTool=false --self-contained --output $(Build.ArtifactStagingDirectory)/Microsoft.OpenApi.Hidi
197
185
projects : ' src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj'
198
186
publishWebProjects : False
199
187
zipAfterPublish : false
@@ -206,10 +194,17 @@ extends:
206
194
content : ' *.nupkg'
207
195
208
196
- stage : deploy
209
- condition : and(contains(variables['build.sourceBranch'], 'refs/heads/master' ), succeeded())
197
+ condition : and(or( contains(variables['build.sourceBranch'], 'refs/heads/main'),contains(variables['build.sourceBranch'], 'refs/heads/support/v1') ), succeeded())
210
198
dependsOn : build
211
199
jobs :
212
200
- deployment : deploy_hidi
201
+ templateContext :
202
+ type : releaseJob
203
+ isProduction : true
204
+ inputs :
205
+ - input : pipelineArtifact
206
+ artifactName : Nugets
207
+ targetPath : ' $(Pipeline.Workspace)'
213
208
dependsOn : []
214
209
environment : nuget-org
215
210
strategy :
@@ -218,15 +213,6 @@ extends:
218
213
pool :
219
214
vmImage : ubuntu-latest
220
215
steps :
221
- - task : DownloadPipelineArtifact@2
222
- displayName : Download nupkg from artifacts
223
- inputs :
224
- artifact : Nugets
225
- source : current
226
- - task : DownloadPipelineArtifact@2
227
- displayName : Download hidi executable from artifacts
228
- inputs :
229
- source : current
230
216
- pwsh : |
231
217
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace)\Nugets -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
232
218
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
@@ -264,6 +250,13 @@ extends:
264
250
]'
265
251
266
252
- deployment : deploy_lib
253
+ templateContext :
254
+ type : releaseJob
255
+ isProduction : true
256
+ inputs :
257
+ - input : pipelineArtifact
258
+ artifactName : Nugets
259
+ targetPath : ' $(Pipeline.Workspace)'
267
260
dependsOn : []
268
261
environment : nuget-org
269
262
strategy :
@@ -272,11 +265,6 @@ extends:
272
265
pool :
273
266
vmImage : ubuntu-latest
274
267
steps :
275
- - task : DownloadPipelineArtifact@2
276
- displayName : Download nupkg from artifacts
277
- inputs :
278
- artifact : Nugets
279
- source : current
280
268
- powershell : |
281
269
$fileNames = "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Readers.*.nupkg", "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Workbench.*.nupkg"
282
270
foreach($fileName in $fileNames) {
@@ -294,6 +282,13 @@ extends:
294
282
publishFeedCredentials : ' OpenAPI Nuget Connection'
295
283
296
284
- deployment : deploy_readers
285
+ templateContext :
286
+ type : releaseJob
287
+ isProduction : true
288
+ inputs :
289
+ - input : pipelineArtifact
290
+ artifactName : Nugets
291
+ targetPath : ' $(Pipeline.Workspace)'
297
292
dependsOn : deploy_lib
298
293
environment : nuget-org
299
294
strategy :
@@ -302,11 +297,6 @@ extends:
302
297
pool :
303
298
vmImage : ubuntu-latest
304
299
steps :
305
- - task : DownloadPipelineArtifact@2
306
- displayName : Download nupkg from artifacts
307
- inputs :
308
- artifact : Nugets
309
- source : current
310
300
- task : 1ES.PublishNuget@1
311
301
displayName : ' NuGet push'
312
302
inputs :
0 commit comments