-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use template for release pipelines (converted from classic) (#3945)
* try to convert release pipeline to yaml * ensure trigger * fix variable expansion * specify name specifically * add release and fix powershell setup * fix name * uncomment vsce task * only do release pipeline on release branch * only allow rel branch for release * enable trigger always, we can rely on manual verification
- Loading branch information
1 parent
ccd3f09
commit fa46827
Showing
3 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# ================================================================================== | ||
# Release Pipeline for pre-release | ||
# ================================================================================== | ||
|
||
name: PrereleaseRelease-$(Date:yyyyMMdd).$(Rev:r) | ||
trigger: none | ||
|
||
resources: | ||
repositories: | ||
- repository: 1ESPipelineTemplates | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
pipelines: | ||
- pipeline: BuildPrereleasePipeline | ||
source: '\VC\VSCode\CMakeTools\vscode-cmake-tools - pre-release [YAML]' | ||
trigger: true | ||
|
||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates | ||
parameters: | ||
pool: | ||
name: VSEngSS-MicroBuild2022-1ES | ||
|
||
stages: | ||
- stage: release | ||
jobs: | ||
- job: release | ||
templateContext: | ||
type: releaseJob | ||
isProduction: true | ||
inputs: | ||
- input: artifactsDrop | ||
pipeline: BuildPrereleasePipeline | ||
artifactName: vsix | ||
|
||
steps: | ||
- powershell: | | ||
$newVersion = Get-Content -Path build\vsix\version.txt | ||
Write-Host "New version is: $newVersion" | ||
$str = Get-Date -Format "yyMMdd-HHmm" | ||
Write-Host "##vso[release.updatereleasename]$newVersion - $str" | ||
ignoreLASTEXITCODE: true | ||
displayName: 'Set the release name' | ||
- task: NodeTool@0 | ||
displayName: 'Use Node 14.x' | ||
inputs: | ||
versionSpec: 14.x | ||
- task: Npm@0 | ||
displayName: 'install vsce' | ||
inputs: | ||
arguments: '-g vsce' | ||
- task: AzureCLI@2 | ||
displayName: 'Generate AAD_TOKEN' | ||
inputs: | ||
azureSubscription: '$(AzureSubscription)' | ||
scriptType: ps | ||
scriptLocation: inlineScript | ||
inlineScript: | | ||
$aadToken = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv | ||
Write-Host "##vso[task.setvariable variable=AAD_TOKEN;issecret=true]$aadToken" | ||
- script: | | ||
vsce publish --packagePath build\vsix\cmake-tools.vsix --pre-release | ||
displayName: 'Publish the VSIX' | ||
env: | ||
VSCE_PAT: $(AAD_TOKEN) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# ================================================================================== | ||
# Release Pipeline for release | ||
# ================================================================================== | ||
|
||
name: OfficialRelease-$(Date:yyyyMMdd).$(Rev:r) | ||
trigger: none | ||
|
||
resources: | ||
repositories: | ||
- repository: 1ESPipelineTemplates | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
pipelines: | ||
- pipeline: BuildReleasePipeline | ||
source: '\VC\VSCode\CMakeTools\vscode-cmake-tools - release [YAML]' | ||
trigger: true | ||
|
||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates | ||
parameters: | ||
pool: | ||
name: VSEngSS-MicroBuild2022-1ES | ||
|
||
stages: | ||
- stage: release | ||
jobs: | ||
- job: release | ||
templateContext: | ||
type: releaseJob | ||
isProduction: true | ||
inputs: | ||
- input: artifactsDrop | ||
pipeline: BuildReleasePipeline | ||
artifactName: vsix | ||
|
||
steps: | ||
- powershell: | | ||
$newVersion = Get-Content -Path build\vsix\version.txt | ||
Write-Host "New version is: $newVersion" | ||
$str = Get-Date -Format "yyMMdd-HHmm" | ||
Write-Host "##vso[release.updatereleasename]$newVersion - $str" | ||
ignoreLASTEXITCODE: true | ||
displayName: 'Set the release name' | ||
- task: ManualIntervention@8 | ||
displayName: 'Manual Intervention' | ||
inputs: | ||
instructions: | | ||
Download and test the vsix from the latest release build: https://devdiv.visualstudio.com/DevDiv/_build?definitionId=17431 | ||
The version should match the name of this release. | ||
- task: NodeTool@0 | ||
displayName: 'Use Node 14.x' | ||
inputs: | ||
versionSpec: 14.x | ||
- task: Npm@0 | ||
displayName: 'install vsce' | ||
inputs: | ||
arguments: '-g vsce' | ||
- task: AzureCLI@2 | ||
displayName: 'Generate AAD_TOKEN' | ||
inputs: | ||
azureSubscription: '$(AzureSubscription)' | ||
scriptType: ps | ||
scriptLocation: inlineScript | ||
inlineScript: | | ||
$aadToken = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv | ||
Write-Host "##vso[task.setvariable variable=AAD_TOKEN;issecret=true]$aadToken" | ||
- script: | | ||
vsce publish --packagePath build\vsix\cmake-tools.vsix | ||
displayName: 'Publish the VSIX' | ||
env: | ||
VSCE_PAT: $(AAD_TOKEN) | ||