Skip to content

Commit

Permalink
ci: moves create github release to its own job
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Dec 20, 2024
1 parent 9c46b3c commit de67664
Showing 1 changed file with 46 additions and 28 deletions.
74 changes: 46 additions & 28 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,40 +213,13 @@ extends:
pool:
vmImage: ubuntu-latest
steps:
- pwsh: |
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace)\Nugets -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
#Set Variable $artifactName and $artifactVersion
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false; isOutput=true]$artifactVersion"
echo "$artifactVersion"
displayName: 'Fetch Artifact Name'
name: getTagVersion
- task: 1ES.PublishNuget@1
displayName: 'NuGet push'
inputs:
packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Hidi.*.nupkg'
packageParentPath: '$(Pipeline.Workspace)'
nuGetFeedType: external
publishFeedCredentials: 'OpenAPI Nuget Connection'
- task: GitHubRelease@1
displayName: 'GitHub release (edit)'
condition: succeededOrFailed()
inputs:
gitHubConnection: 'Github-MaggieKimani1'
action: create
tagSource: userSpecifiedTag
tag: '$(getTagVersion.artifactVersion)'
title: '$(getTagVersion.artifactVersion)'
releaseNotesSource: inline
assets: '$(Pipeline.Workspace)\**\*.exe'
changeLogType: issueBased
changeLogLabels: '[
{ "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" },
{ "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" },
{ "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" },
{ "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"},
{ "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" }
]'

- deployment: deploy_lib
templateContext:
Expand Down Expand Up @@ -302,4 +275,49 @@ extends:
packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Readers.*.nupkg'
packageParentPath: '$(Pipeline.Workspace)'
nuGetFeedType: external
publishFeedCredentials: 'OpenAPI Nuget Connection'
publishFeedCredentials: 'OpenAPI Nuget Connection'

- deployment: create_github_release
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: Nugets
targetPath: '$(Pipeline.Workspace)'
dependsOn: []
environment: kiota-github-releases
strategy:
runOnce:
deploy:
pool:
vmImage: ubuntu-latest
steps:
- pwsh: |
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace)\Nugets -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
#Set Variable $artifactName and $artifactVersion
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false; isOutput=true]$artifactVersion"
echo "$artifactVersion"
displayName: 'Fetch Artifact Name'
name: getTagVersion
- task: GitHubRelease@1
displayName: 'GitHub release (edit)'
condition: succeededOrFailed()
inputs:
gitHubConnection: 'Github-MaggieKimani1'
action: create
tagSource: userSpecifiedTag
tag: '$(getTagVersion.artifactVersion)'
title: '$(getTagVersion.artifactVersion)'
releaseNotesSource: inline
assets: '$(Pipeline.Workspace)\**\*.exe'
changeLogType: issueBased
changeLogLabels: '[
{ "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" },
{ "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" },
{ "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" },
{ "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"},
{ "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" }
]'

0 comments on commit de67664

Please sign in to comment.