@@ -201,123 +201,123 @@ extends:
201201 content : ' *.nupkg'
202202
203203 - stage : deploy
204- condition : and(contains( variables['build.sourceBranch '], 'refs/tags/v'), succeeded( ))
204+ condition : and(or(startsWith( variables['Build.SourceBranch '], 'refs/tags/v'), eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])), not(contains(variables['Build.SourceBranch'], '-preview') ))
205205 dependsOn : build
206206 jobs :
207- - deployment : deploy_hidi
208- templateContext :
209- type : releaseJob
210- isProduction : true
211- inputs :
212- - input : pipelineArtifact
213- artifactName : Nugets
214- targetPath : ' $(Pipeline.Workspace)'
215- dependsOn : []
216- environment : nuget-org
217- strategy :
218- runOnce :
219- deploy :
220- pool :
221- vmImage : ubuntu-latest
222- steps :
223- - task : 1ES.PublishNuget@1
224- displayName : ' NuGet push'
225- inputs :
226- packagesToPush : ' $(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg'
227- packageParentPath : ' $(Pipeline.Workspace)'
228- nuGetFeedType : external
229- publishFeedCredentials : ' OpenAPI Nuget Connection'
207+ # - deployment: deploy_hidi
208+ # templateContext:
209+ # type: releaseJob
210+ # isProduction: true
211+ # inputs:
212+ # - input: pipelineArtifact
213+ # artifactName: Nugets
214+ # targetPath: '$(Pipeline.Workspace)'
215+ # dependsOn: []
216+ # environment: nuget-org
217+ # strategy:
218+ # runOnce:
219+ # deploy:
220+ # pool:
221+ # vmImage: ubuntu-latest
222+ # steps:
223+ # - task: 1ES.PublishNuget@1
224+ # displayName: 'NuGet push'
225+ # inputs:
226+ # packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg'
227+ # packageParentPath: '$(Pipeline.Workspace)'
228+ # nuGetFeedType: external
229+ # publishFeedCredentials: 'OpenAPI Nuget Connection'
230230
231- - deployment : deploy_lib
232- templateContext :
233- type : releaseJob
234- isProduction : true
235- inputs :
236- - input : pipelineArtifact
237- artifactName : Nugets
238- targetPath : ' $(Pipeline.Workspace)'
239- dependsOn : []
240- environment : nuget-org
241- strategy :
242- runOnce :
243- deploy :
244- pool :
245- vmImage : ubuntu-latest
246- steps :
247- - powershell : |
248- $fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
249- foreach($fileName in $fileNames) {
250- if(Test-Path $fileName) {
251- rm $fileName -Verbose
252- }
253- }
254- displayName: remove other nupkgs to avoid duplication
255- - task : 1ES.PublishNuget@1
256- displayName : ' NuGet push'
257- inputs :
258- packagesToPush : ' $(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
259- packageParentPath : ' $(Pipeline.Workspace)'
260- nuGetFeedType : external
261- publishFeedCredentials : ' OpenAPI Nuget Connection'
231+ # - deployment: deploy_lib
232+ # templateContext:
233+ # type: releaseJob
234+ # isProduction: true
235+ # inputs:
236+ # - input: pipelineArtifact
237+ # artifactName: Nugets
238+ # targetPath: '$(Pipeline.Workspace)'
239+ # dependsOn: []
240+ # environment: nuget-org
241+ # strategy:
242+ # runOnce:
243+ # deploy:
244+ # pool:
245+ # vmImage: ubuntu-latest
246+ # steps:
247+ # - powershell: |
248+ # $fileNames = "$(Pipeline.Workspace)/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg", "$(Pipeline.Workspace)/Microsoft.OpenApi.Workbench.*.nupkg"
249+ # foreach($fileName in $fileNames) {
250+ # if(Test-Path $fileName) {
251+ # rm $fileName -Verbose
252+ # }
253+ # }
254+ # displayName: remove other nupkgs to avoid duplication
255+ # - task: 1ES.PublishNuget@1
256+ # displayName: 'NuGet push'
257+ # inputs:
258+ # packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.*.nupkg'
259+ # packageParentPath: '$(Pipeline.Workspace)'
260+ # nuGetFeedType: external
261+ # publishFeedCredentials: 'OpenAPI Nuget Connection'
262262
263- - deployment : deploy_yaml_reader
264- templateContext :
265- type : releaseJob
266- isProduction : true
267- inputs :
268- - input : pipelineArtifact
269- artifactName : Nugets
270- targetPath : ' $(Pipeline.Workspace)'
271- dependsOn : deploy_lib
272- environment : nuget-org
273- strategy :
274- runOnce :
275- deploy :
276- pool :
277- vmImage : ubuntu-latest
278- steps :
279- - task : 1ES.PublishNuget@1
280- displayName : ' NuGet push'
281- inputs :
282- packagesToPush : ' $(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
283- packageParentPath : ' $(Pipeline.Workspace)'
284- nuGetFeedType : external
285- publishFeedCredentials : ' OpenAPI Nuget Connection'
263+ # - deployment: deploy_yaml_reader
264+ # templateContext:
265+ # type: releaseJob
266+ # isProduction: true
267+ # inputs:
268+ # - input: pipelineArtifact
269+ # artifactName: Nugets
270+ # targetPath: '$(Pipeline.Workspace)'
271+ # dependsOn: deploy_lib
272+ # environment: nuget-org
273+ # strategy:
274+ # runOnce:
275+ # deploy:
276+ # pool:
277+ # vmImage: ubuntu-latest
278+ # steps:
279+ # - task: 1ES.PublishNuget@1
280+ # displayName: 'NuGet push'
281+ # inputs:
282+ # packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.YamlReader.*.nupkg'
283+ # packageParentPath: '$(Pipeline.Workspace)'
284+ # nuGetFeedType: external
285+ # publishFeedCredentials: 'OpenAPI Nuget Connection'
286286
287- - deployment : create_github_release
288- templateContext :
289- type : releaseJob
290- isProduction : true
291- inputs :
292- - input : pipelineArtifact
293- artifactName : Nugets
294- targetPath : ' $(Pipeline.Workspace)'
295- dependsOn : []
296- environment : kiota-github-releases
297- strategy :
298- runOnce :
299- deploy :
300- pool :
301- vmImage : ubuntu-latest
302- steps :
303- - pwsh : |
304- $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
305- $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
306- #Set Variable $artifactName and $artifactVersion
307- Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
308- echo "$artifactVersion"
309- displayName: 'Fetch Artifact Name'
310- - task : GitHubRelease@1
311- displayName : ' GitHub release (edit)'
312- condition : succeededOrFailed()
313- inputs :
314- gitHubConnection : ' Github-MaggieKimani1'
315- action : edit
316- tagSource : userSpecifiedTag
317- tag : ' v$(artifactVersion)'
318- releaseNotesSource : inline
319- assets : ' $(Pipeline.Workspace)\**\*.exe'
320- addChangeLog : false
287+ # - deployment: create_github_release
288+ # templateContext:
289+ # type: releaseJob
290+ # isProduction: true
291+ # inputs:
292+ # - input: pipelineArtifact
293+ # artifactName: Nugets
294+ # targetPath: '$(Pipeline.Workspace)'
295+ # dependsOn: []
296+ # environment: kiota-github-releases
297+ # strategy:
298+ # runOnce:
299+ # deploy:
300+ # pool:
301+ # vmImage: ubuntu-latest
302+ # steps:
303+ # - pwsh: |
304+ # $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
305+ # $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
306+ # #Set Variable $artifactName and $artifactVersion
307+ # Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
308+ # echo "$artifactVersion"
309+ # displayName: 'Fetch Artifact Name'
310+ # - task: GitHubRelease@1
311+ # displayName: 'GitHub release (edit)'
312+ # condition: succeededOrFailed()
313+ # inputs:
314+ # gitHubConnection: 'Github-MaggieKimani1'
315+ # action: edit
316+ # tagSource: userSpecifiedTag
317+ # tag: 'v$(artifactVersion)'
318+ # releaseNotesSource: inline
319+ # assets: '$(Pipeline.Workspace)\**\*.exe'
320+ # addChangeLog: false
321321
322322 - deployment : deploy_docker_image
323323 environment : kiota-github-releases
0 commit comments