Skip to content

Commit 7cd3d84

Browse files
authored
Move GitHub Release tasks to separate explicitly release jobs (#692)
* Move GitHub Release tasks to separate explicitly release jobs
1 parent ae389f5 commit 7cd3d84

File tree

4 files changed

+70
-4
lines changed

4 files changed

+70
-4
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.60] - 2025-06-36
8+
## Pipelines
9+
Pipeline updates
10+
711
## [1.0.59] - 2025-06-10
812
## Misc (non-code)
913
Removes old doc publish workflow.

Pipelines/cli/devskim-cli-release.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ extends:
106106
outputs:
107107
- output: pipelineArtifact
108108
path: '$(Build.StagingDirectory)'
109-
artifact: 'Signed_Binaries_$(System.JobId)_$(System.JobAttempt)'
109+
artifact: 'Signed_Binaries'
110110
# see https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs/nuget-packages
111111
- output: nuget
112112
useDotNetTask: false
@@ -121,6 +121,12 @@ extends:
121121
packageType: 'sdk'
122122
version: ${{ variables.DotnetVersion }}
123123
- template: nbgv-set-version-steps.yml@templates
124+
# set-version-steps only sets it for current job, while adding isOutput only sets it for future jobs
125+
# 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
126+
- powershell: |
127+
$version = (nbgv get-version -v AssemblyInformationalVersion).split('+')[0]
128+
Write-Host "##vso[task.setvariable variable=releaseVersion;isOutput=true]$version"
129+
name: outputReleaseVersionVar
124130
- task: DownloadPipelineArtifact@2
125131
inputs:
126132
displayName: 'Download linux-mac-archive'
@@ -554,6 +560,21 @@ extends:
554560
$tmp = (Get-FileHash "$(Build.StagingDirectory)\$name").Hash
555561
Add-Content $(Build.StagingDirectory)\HASHES.txt "$tmp`t$name"
556562
}
563+
- job: gitHubReleaseJob
564+
# 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
565+
displayName: GitHub Release Job
566+
dependsOn: sign_hash_release
567+
variables:
568+
ReleaseVersion: $[ dependencies.sign_hash_release.outputs['outputReleaseVersionVar.releaseVersion'] ]
569+
# pool: you can optionally specify pool as you would normally do for a standard job
570+
templateContext:
571+
type: releaseJob # Required, this indicates this job is a release job
572+
isProduction: true # Required, must be 'true' or 'false'
573+
inputs: # All input build artifacts must be declared here
574+
- input: pipelineArtifact # Required, type of the input artifact
575+
artifactName: Signed_Binaries # Required, name of the pipeline artifact
576+
targetPath: $(Pipeline.Workspace)/drop # Optional, specifies where the artifact is downloaded
577+
steps:
557578
- task: GitHubRelease@1
558579
displayName: Release to GitHub
559580
inputs:

Pipelines/vs/devskim-visualstudio-release.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,15 @@ extends:
7474
outputs:
7575
- output: pipelineArtifact
7676
path: '$(Build.StagingDirectory)'
77-
artifact: 'Signed_Binaries_$(System.JobId)_$(System.JobAttempt)'
77+
artifact: 'Signed_Binaries'
7878
steps:
7979
- template: nbgv-set-version-steps.yml@templates
80+
# set-version-steps only sets it for current job, while adding isOutput only sets it for future jobs
81+
# 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
82+
- powershell: |
83+
$version = (nbgv get-version -v AssemblyInformationalVersion).split('+')[0]
84+
Write-Host "##vso[task.setvariable variable=releaseVersion;isOutput=true]$version"
85+
name: outputReleaseVersionVar
8086
- task: DownloadPipelineArtifact@2
8187
displayName: Retrieve Unsigned Artifact
8288
inputs:
@@ -169,6 +175,21 @@ extends:
169175
$vsixPath = Resolve-Path $env:BUILD_STAGINGDIRECTORY\*.vsix -Relative
170176
& $vsixPublisher publish -payload $vsixPath -publishManifest $(Build.StagingDirectory)/publish.manifest.json -personalAccessToken $aadToken -ignoreWarnings "VSIXValidatorWarning01,VSIXValidatorWarning02,VSIXValidatorWarning08"
171177
workingDirectory: '$(Build.StagingDirectory)'
178+
- job: gitHubReleaseJob
179+
# 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
180+
displayName: GitHub Release Job
181+
dependsOn: sign_hash_release
182+
variables:
183+
ReleaseVersion: $[ dependencies.sign_hash_release.outputs['outputReleaseVersionVar.releaseVersion'] ]
184+
# pool: you can optionally specify pool as you would normally do for a standard job
185+
templateContext:
186+
type: releaseJob # Required, this indicates this job is a release job
187+
isProduction: true # Required, must be 'true' or 'false'
188+
inputs: # All input build artifacts must be declared here
189+
- input: pipelineArtifact # Required, type of the input artifact
190+
artifactName: Signed_Binaries # Required, name of the pipeline artifact
191+
targetPath: $(Pipeline.Workspace)/drop # Optional, specifies where the artifact is downloaded
192+
steps:
172193
- task: GitHubRelease@1
173194
displayName: Release to GitHub
174195
inputs:

Pipelines/vscode/devskim-vscode-release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ extends:
8383
outputs:
8484
- output: pipelineArtifact
8585
path: '$(Build.StagingDirectory)'
86-
artifact: 'Signed_Binaries_$(System.JobId)_$(System.JobAttempt)'
86+
artifact: 'Signed_Binaries'
8787
steps:
8888
- template: nbgv-set-version-steps.yml@templates
89+
# set-version-steps only sets it for current job, while adding isOutput only sets it for future jobs
90+
# 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
91+
- powershell: |
92+
$version = (nbgv get-version -v AssemblyInformationalVersion).split('+')[0]
93+
Write-Host "##vso[task.setvariable variable=releaseVersion;isOutput=true]$version"
94+
name: outputReleaseVersionVar
8995
- task: DownloadPipelineArtifact@2
9096
displayName: Retrieve Unsigned Artifact
9197
inputs:
@@ -180,7 +186,21 @@ extends:
180186
echo "Publishing as official release = $(ReleaseVersion)"
181187
vsce publish --packagePath $packPath --azure-credential
182188
}
183-
189+
- job: gitHubReleaseJob
190+
# 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
191+
displayName: GitHub Release Job
192+
dependsOn: sign_hash_release
193+
variables:
194+
ReleaseVersion: $[ dependencies.sign_hash_release.outputs['outputReleaseVersionVar.releaseVersion'] ]
195+
# pool: you can optionally specify pool as you would normally do for a standard job
196+
templateContext:
197+
type: releaseJob # Required, this indicates this job is a release job
198+
isProduction: true # Required, must be 'true' or 'false'
199+
inputs: # All input build artifacts must be declared here
200+
- input: pipelineArtifact # Required, type of the input artifact
201+
artifactName: Signed_Binaries # Required, name of the pipeline artifact
202+
targetPath: $(Pipeline.Workspace)/drop # Optional, specifies where the artifact is downloaded
203+
steps:
184204
- task: GitHubRelease@1
185205
displayName: Release to GitHub
186206
inputs:

0 commit comments

Comments
 (0)