7
7
include :
8
8
- main
9
9
- support/v1
10
- - task/move-to-deploy-stage
11
10
tags :
12
11
include :
13
12
- ' v*'
16
15
include :
17
16
- main
18
17
- support/v1
19
- - task/move-to-deploy-stage
20
18
21
19
variables :
22
20
buildPlatform : ' Any CPU'
23
21
buildConfiguration : ' Release'
24
22
ProductBinPath : ' $(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)'
25
- REGISTRY : ' msgraphpperegistry .azurecr.io'
23
+ REGISTRY : ' msgraphprodregistry .azurecr.io'
26
24
IMAGE_NAME : ' public/openapi/hidi'
27
- PREVIEW_BRANCH : ' refs/heads/task/move-to-deploy-stage '
25
+ PREVIEW_BRANCH : ' refs/heads/main '
28
26
29
27
resources :
30
28
repositories :
@@ -202,15 +200,15 @@ extends:
202
200
content : ' *.nupkg'
203
201
204
202
- stage : deploy
205
- condition : and(or(contains(variables['Build.sourceBranch '], 'refs/tags/v'), eq(variables['Build.sourceBranch '], variables['PREVIEW_BRANCH'])), succeeded())
203
+ condition : and(or(contains(variables['Build.SourceBranch '], 'refs/tags/v'), eq(variables['Build.SourceBranch '], variables['PREVIEW_BRANCH'])), succeeded())
206
204
dependsOn : build
207
205
pool :
208
206
name : Azure-Pipelines-1ESPT-ExDShared
209
207
os : linux
210
208
image : ubuntu-latest
211
209
jobs :
212
210
- deployment : deploy_hidi
213
- condition : and(contains(variables['build.sourceBranch '], 'refs/tags/v'), succeeded())
211
+ condition : and(contains(variables['build.SourceBranch '], 'refs/tags/v'), succeeded())
214
212
templateContext :
215
213
type : releaseJob
216
214
isProduction : true
@@ -234,98 +232,98 @@ extends:
234
232
nuGetFeedType : external
235
233
publishFeedCredentials : ' OpenAPI Nuget Connection'
236
234
237
- # - deployment: deploy_lib
238
- # condition: and(contains(variables['build.sourceBranch '], 'refs/tags/v'), succeeded())
239
- # templateContext:
240
- # type: releaseJob
241
- # isProduction: true
242
- # inputs:
243
- # - input: pipelineArtifact
244
- # artifactName: Nugets
245
- # targetPath: '$(Pipeline.Workspace)'
246
- # dependsOn: []
247
- # environment: nuget-org
248
- # strategy:
249
- # runOnce:
250
- # deploy:
251
- # pool:
252
- # vmImage: ubuntu-latest
253
- # steps:
254
- # - powershell: |
255
- # $fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
256
- # foreach($fileName in $fileNames) {
257
- # if(Test-Path $fileName) {
258
- # rm $fileName -Verbose
259
- # }
260
- # }
261
- # displayName: remove other nupkgs to avoid duplication
262
- # - task: 1ES.PublishNuget@1
263
- # displayName: 'NuGet push'
264
- # inputs:
265
- # packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
266
- # packageParentPath: '$(Pipeline.Workspace)'
267
- # nuGetFeedType: external
268
- # publishFeedCredentials: 'OpenAPI Nuget Connection'
235
+ - deployment : deploy_lib
236
+ condition : and(contains(variables['build.SourceBranch '], 'refs/tags/v'), succeeded())
237
+ templateContext :
238
+ type : releaseJob
239
+ isProduction : true
240
+ inputs :
241
+ - input : pipelineArtifact
242
+ artifactName : Nugets
243
+ targetPath : ' $(Pipeline.Workspace)'
244
+ dependsOn : []
245
+ environment : nuget-org
246
+ strategy :
247
+ runOnce :
248
+ deploy :
249
+ pool :
250
+ vmImage : ubuntu-latest
251
+ steps :
252
+ - powershell : |
253
+ $fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
254
+ foreach($fileName in $fileNames) {
255
+ if(Test-Path $fileName) {
256
+ rm $fileName -Verbose
257
+ }
258
+ }
259
+ displayName: remove other nupkgs to avoid duplication
260
+ - task : 1ES.PublishNuget@1
261
+ displayName : ' NuGet push'
262
+ inputs :
263
+ packagesToPush : ' $(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
264
+ packageParentPath : ' $(Pipeline.Workspace)'
265
+ nuGetFeedType : external
266
+ publishFeedCredentials : ' OpenAPI Nuget Connection'
269
267
270
- # - deployment: deploy_yaml_reader
271
- # condition: and(contains(variables['build.sourceBranch '], 'refs/tags/v'), succeeded())
272
- # templateContext:
273
- # type: releaseJob
274
- # isProduction: true
275
- # inputs:
276
- # - input: pipelineArtifact
277
- # artifactName: Nugets
278
- # targetPath: '$(Pipeline.Workspace)'
279
- # dependsOn: deploy_lib
280
- # environment: nuget-org
281
- # strategy:
282
- # runOnce:
283
- # deploy:
284
- # pool:
285
- # vmImage: ubuntu-latest
286
- # steps:
287
- # - task: 1ES.PublishNuget@1
288
- # displayName: 'NuGet push'
289
- # inputs:
290
- # packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
291
- # packageParentPath: '$(Pipeline.Workspace)'
292
- # nuGetFeedType: external
293
- # publishFeedCredentials: 'OpenAPI Nuget Connection'
268
+ - deployment : deploy_yaml_reader
269
+ condition : and(contains(variables['build.SourceBranch '], 'refs/tags/v'), succeeded())
270
+ templateContext :
271
+ type : releaseJob
272
+ isProduction : true
273
+ inputs :
274
+ - input : pipelineArtifact
275
+ artifactName : Nugets
276
+ targetPath : ' $(Pipeline.Workspace)'
277
+ dependsOn : deploy_lib
278
+ environment : nuget-org
279
+ strategy :
280
+ runOnce :
281
+ deploy :
282
+ pool :
283
+ vmImage : ubuntu-latest
284
+ steps :
285
+ - task : 1ES.PublishNuget@1
286
+ displayName : ' NuGet push'
287
+ inputs :
288
+ packagesToPush : ' $(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
289
+ packageParentPath : ' $(Pipeline.Workspace)'
290
+ nuGetFeedType : external
291
+ publishFeedCredentials : ' OpenAPI Nuget Connection'
294
292
295
- # - deployment: create_github_release
296
- # templateContext:
297
- # type: releaseJob
298
- # isProduction: true
299
- # inputs:
300
- # - input: pipelineArtifact
301
- # artifactName: Nugets
302
- # targetPath: '$(Pipeline.Workspace)'
303
- # dependsOn: []
304
- # environment: kiota-github-releases
305
- # strategy:
306
- # runOnce:
307
- # deploy:
308
- # pool:
309
- # vmImage: ubuntu-latest
310
- # steps:
311
- # - pwsh: |
312
- # $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
313
- # $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
314
- # #Set Variable $artifactName and $artifactVersion
315
- # Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
316
- # echo "$artifactVersion"
317
- # displayName: 'Fetch Artifact Name'
318
- # - task: GitHubRelease@1
319
- # displayName: 'GitHub release (edit)'
320
- # condition: succeededOrFailed()
321
- # inputs:
322
- # gitHubConnection: 'Github-MaggieKimani1'
323
- # action: edit
324
- # tagSource: userSpecifiedTag
325
- # tag: 'v$(artifactVersion)'
326
- # releaseNotesSource: inline
327
- # assets: '$(Pipeline.Workspace)\**\*.exe'
328
- # addChangeLog: false
293
+ - deployment : create_github_release
294
+ templateContext :
295
+ type : releaseJob
296
+ isProduction : true
297
+ inputs :
298
+ - input : pipelineArtifact
299
+ artifactName : Nugets
300
+ targetPath : ' $(Pipeline.Workspace)'
301
+ dependsOn : []
302
+ environment : kiota-github-releases
303
+ strategy :
304
+ runOnce :
305
+ deploy :
306
+ pool :
307
+ vmImage : ubuntu-latest
308
+ steps :
309
+ - pwsh : |
310
+ $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
311
+ $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
312
+ #Set Variable $artifactName and $artifactVersion
313
+ Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
314
+ echo "$artifactVersion"
315
+ displayName: 'Fetch Artifact Name'
316
+ - task : GitHubRelease@1
317
+ displayName : ' GitHub release (edit)'
318
+ condition : succeededOrFailed()
319
+ inputs :
320
+ gitHubConnection : ' Github-MaggieKimani1'
321
+ action : edit
322
+ tagSource : userSpecifiedTag
323
+ tag : ' v$(artifactVersion)'
324
+ releaseNotesSource : inline
325
+ assets : ' $(Pipeline.Workspace)\**\*.exe'
326
+ addChangeLog : false
329
327
330
328
- deployment : deploy_docker_image
331
329
environment : kiota-github-releases
@@ -340,11 +338,11 @@ extends:
340
338
- task : AzureCLI@2
341
339
displayName : ' Login to Azure Container Registry'
342
340
inputs :
343
- azureSubscription : ' ACR Push Test '
341
+ azureSubscription : ' ACR Images Push Service Connection '
344
342
scriptType : bash
345
343
scriptLocation : inlineScript
346
344
inlineScript : |
347
- az acr login --name msgraphpperegistry
345
+ az acr login --name msgraphprodregistry
348
346
349
347
- powershell : |
350
348
$content = [XML](Get-Content ./Directory.Build.props)
@@ -404,7 +402,7 @@ extends:
404
402
echo "##vso[task.setvariable variable=RUNNUMBER;isOutput=true]$runnumber"
405
403
displayName: 'Get truncated run number'
406
404
name: getrunnumber
407
- condition: eq(variables['Build.sourceBranch '], variables['PREVIEW_BRANCH'])
405
+ condition: eq(variables['Build.SourceBranch '], variables['PREVIEW_BRANCH'])
408
406
409
407
- bash : |
410
408
date=$(date +'%Y%m%d')
@@ -413,7 +411,7 @@ extends:
413
411
echo "##vso[task.setvariable variable=BUILDDATE]$date"
414
412
displayName: 'Get current date'
415
413
name: setdate
416
- condition: eq(variables['Build.sourceBranch '], variables['PREVIEW_BRANCH'])
414
+ condition: eq(variables['Build.SourceBranch '], variables['PREVIEW_BRANCH'])
417
415
418
416
- script : |
419
417
docker run --privileged --rm tonistiigi/binfmt --install all
@@ -439,7 +437,7 @@ extends:
439
437
"$(Build.SourcesDirectory)"
440
438
441
439
displayName: 'Build and Push Nightly Image'
442
- condition: eq(variables['Build.sourceBranch '], variables['PREVIEW_BRANCH'])
440
+ condition: eq(variables['Build.SourceBranch '], variables['PREVIEW_BRANCH'])
443
441
444
442
- bash : |
445
443
echo "Building Docker image for release..."
@@ -450,4 +448,4 @@ extends:
450
448
-t "$(REGISTRY)/$(IMAGE_NAME):${VERSION}.${BUILDDATE}${RUNNUMBER}" \
451
449
"$(Build.SourcesDirectory)"
452
450
displayName: 'Build and Push Release Image'
453
- condition: contains(variables['Build.sourceBranch '], 'refs/tags/v')
451
+ condition: contains(variables['Build.SourceBranch '], 'refs/tags/v')
0 commit comments