Skip to content

Commit 3dabe4a

Browse files
authored
Move github release to separate job (#746)
* Move github release to separate job
1 parent 39838d3 commit 3dabe4a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Pipelines/asa-release.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extends:
100100
outputs:
101101
- output: pipelineArtifact
102102
path: '$(Build.StagingDirectory)'
103-
artifact: 'Signed_Binaries_$(System.JobId)_$(System.JobAttempt)'
103+
artifact: 'Signed_Binaries'
104104
# see https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs/nuget-packages
105105
- output: nuget
106106
useDotNetTask: false
@@ -111,6 +111,12 @@ extends:
111111
publishFeedCredentials: 'sdl-oss-nuget-publish'
112112
steps:
113113
- template: nbgv-set-version-steps.yml@templates
114+
# set-version-steps only sets it for current job, while adding isOutput only sets it for future jobs
115+
# https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell#set-an-output-variable-for-use-in-future-jobs
116+
- powershell: |
117+
$version = (nbgv get-version -v AssemblyInformationalVersion).split('+')[0]
118+
Write-Host "##vso[task.setvariable variable=releaseVersion;isOutput=true]$version"
119+
name: outputReleaseVersionVar
114120
- task: UseDotNet@2
115121
inputs:
116122
packageType: 'sdk'
@@ -547,6 +553,21 @@ extends:
547553
script: |
548554
mv $env:BUILD_BINARIESDIRECTORY/*.nupkg $env:BUILD_STAGINGDIRECTORY/
549555
mv $env:BUILD_BINARIESDIRECTORY/*.snupkg $env:BUILD_STAGINGDIRECTORY/
556+
- job: gitHubReleaseJob
557+
# Based on Documentation: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/releasepipelines/releaseworkflows/releasejob?tabs=standardreleasejob
558+
displayName: GitHub Release Job
559+
dependsOn: sign_hash_release
560+
variables:
561+
ReleaseVersion: $[ dependencies.sign_hash_release.outputs['outputReleaseVersionVar.releaseVersion'] ]
562+
# pool: you can optionally specify pool as you would normally do for a standard job
563+
templateContext:
564+
type: releaseJob # Required, this indicates this job is a release job
565+
isProduction: true # Required, must be 'true' or 'false'
566+
inputs: # All input build artifacts must be declared here
567+
- input: pipelineArtifact # Required, type of the input artifact
568+
artifactName: Signed_Binaries # Required, name of the pipeline artifact
569+
targetPath: $(Pipeline.Workspace)/drop # Optional, specifies where the artifact is downloaded
570+
steps:
550571
- task: GitHubRelease@1
551572
displayName: Release to GitHub
552573
inputs:

0 commit comments

Comments
 (0)