77 include :
88 - main
99 - support/v1
10- - task/move-to-deploy-stage
1110 tags :
1211 include :
1312 - ' v*'
1615 include :
1716 - main
1817 - support/v1
19- - task/move-to-deploy-stage
2018
2119variables :
2220 buildPlatform : ' Any CPU'
2321 buildConfiguration : ' Release'
2422 ProductBinPath : ' $(Build.SourcesDirectory)\src\Microsoft.OpenApi\bin\$(BuildConfiguration)'
25- REGISTRY : ' msgraphpperegistry .azurecr.io'
23+ REGISTRY : ' msgraphprodregistry .azurecr.io'
2624 IMAGE_NAME : ' public/openapi/hidi'
27- PREVIEW_BRANCH : ' refs/heads/task/move-to-deploy-stage '
25+ PREVIEW_BRANCH : ' refs/heads/main '
2826
2927resources :
3028 repositories :
@@ -202,15 +200,15 @@ extends:
202200 content : ' *.nupkg'
203201
204202 - 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())
206204 dependsOn : build
207205 pool :
208206 name : Azure-Pipelines-1ESPT-ExDShared
209207 os : linux
210208 image : ubuntu-latest
211209 jobs :
212210 - 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())
214212 templateContext :
215213 type : releaseJob
216214 isProduction : true
@@ -234,98 +232,98 @@ extends:
234232 nuGetFeedType : external
235233 publishFeedCredentials : ' OpenAPI Nuget Connection'
236234
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'
269267
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'
294292
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
329327
330328 - deployment : deploy_docker_image
331329 environment : kiota-github-releases
@@ -340,11 +338,11 @@ extends:
340338 - task : AzureCLI@2
341339 displayName : ' Login to Azure Container Registry'
342340 inputs :
343- azureSubscription : ' ACR Push Test '
341+ azureSubscription : ' ACR Images Push Service Connection '
344342 scriptType : bash
345343 scriptLocation : inlineScript
346344 inlineScript : |
347- az acr login --name msgraphpperegistry
345+ az acr login --name msgraphprodregistry
348346
349347 - powershell : |
350348 $content = [XML](Get-Content ./Directory.Build.props)
@@ -404,7 +402,7 @@ extends:
404402 echo "##vso[task.setvariable variable=RUNNUMBER;isOutput=true]$runnumber"
405403 displayName: 'Get truncated run number'
406404 name: getrunnumber
407- condition: eq(variables['Build.sourceBranch '], variables['PREVIEW_BRANCH'])
405+ condition: eq(variables['Build.SourceBranch '], variables['PREVIEW_BRANCH'])
408406
409407 - bash : |
410408 date=$(date +'%Y%m%d')
@@ -413,7 +411,7 @@ extends:
413411 echo "##vso[task.setvariable variable=BUILDDATE]$date"
414412 displayName: 'Get current date'
415413 name: setdate
416- condition: eq(variables['Build.sourceBranch '], variables['PREVIEW_BRANCH'])
414+ condition: eq(variables['Build.SourceBranch '], variables['PREVIEW_BRANCH'])
417415
418416 - script : |
419417 docker run --privileged --rm tonistiigi/binfmt --install all
@@ -439,7 +437,7 @@ extends:
439437 "$(Build.SourcesDirectory)"
440438
441439 displayName: 'Build and Push Nightly Image'
442- condition: eq(variables['Build.sourceBranch '], variables['PREVIEW_BRANCH'])
440+ condition: eq(variables['Build.SourceBranch '], variables['PREVIEW_BRANCH'])
443441
444442 - bash : |
445443 echo "Building Docker image for release..."
@@ -450,4 +448,4 @@ extends:
450448 -t "$(REGISTRY)/$(IMAGE_NAME):${VERSION}.${BUILDDATE}${RUNNUMBER}" \
451449 "$(Build.SourcesDirectory)"
452450 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