Skip to content

Commit dcbb719

Browse files
committed
ci: adds github release
Signed-off-by: Vincent Biret <[email protected]>
1 parent 9b96617 commit dcbb719

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,47 @@ extends:
213213
nuGetFeedType: external
214214
publishFeedCredentials: 'OpenAPI Nuget Connection'
215215
packageParentPath: '$(Pipeline.Workspace)'
216+
217+
- deployment: create_github_release
218+
templateContext:
219+
type: releaseJob
220+
isProduction: true
221+
inputs:
222+
- input: pipelineArtifact
223+
artifactName: Nugets
224+
targetPath: '$(Pipeline.Workspace)'
225+
dependsOn: []
226+
environment: kiota-github-releases
227+
strategy:
228+
runOnce:
229+
deploy:
230+
pool:
231+
vmImage: ubuntu-latest
232+
steps:
233+
- pwsh: |
234+
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
235+
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData", "" -replace ".nupkg", ""
236+
#Set Variable $artifactName and $artifactVersion
237+
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
238+
echo "$artifactVersion"
239+
displayName: 'Fetch Artifact Name'
240+
- task: GitHubRelease@1
241+
displayName: 'GitHub release'
242+
condition: succeededOrFailed()
243+
inputs:
244+
gitHubConnection: 'Github-MaggieKimani1'
245+
action: create
246+
tagSource: userSpecifiedTag
247+
tag: '$(artifactVersion)'
248+
title: '$(artifactVersion)'
249+
releaseNotesSource: inline
250+
assets: '$(Pipeline.Workspace)\**\*.nupkg'
251+
changeLogType: issueBased
252+
changeLogLabels: '[
253+
{ "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" },
254+
{ "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" },
255+
{ "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" },
256+
{ "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"},
257+
{ "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" }
258+
]'
216259

0 commit comments

Comments
 (0)