Skip to content

Commit

Permalink
Release pipelines for themes and extension pack (#12589)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbrow authored Aug 19, 2024
1 parent 4a7fe28 commit 06ed838
Show file tree
Hide file tree
Showing 7 changed files with 299 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Build/package/cpptools_extension_pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: $(date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none

parameters:
- name: verifyVersion
displayName: Attest version in package.json is correct
type: boolean
default: false
- name: verifyReadme
displayName: Attest README.md is updated
type: boolean
default: false

resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release

extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows

stages:
- stage: package
jobs:
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
- 'The version in package.json should be updated before scheduling the pipeline.'

- ${{ if not(eq(parameters.verifyReadme, true)) }}:
- 'README.md should be updated before scheduling the pipeline.'

- template: /Build/package/jobs_package_vsix.yml@self
parameters:
vsixName: cpptools-extension-pack.vsix
srcDir: ExtensionPack
48 changes: 48 additions & 0 deletions Build/package/cpptools_themes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: $(date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none

parameters:
- name: verifyVersion
displayName: Attest version in package.json is correct
type: boolean
default: false
- name: verifyReadme
displayName: Attest README.md is updated
type: boolean
default: false

resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release

extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows

stages:
- stage: package
jobs:
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
- 'The version in package.json should be updated before scheduling the pipeline.'

- ${{ if not(eq(parameters.verifyReadme, true)) }}:
- 'README.md should be updated before scheduling the pipeline.'

- template: /Build/package/jobs_package_vsix.yml@self
parameters:
vsixName: cpptools-themes.vsix
srcDir: Themes
54 changes: 54 additions & 0 deletions Build/package/jobs_package_vsix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
parameters:
- name: vsixName
type: string
default: ''
- name: srcDir
type: string
default: ''

jobs:
- job: package
displayName: Build ${{ parameters.vsixName }}
timeoutInMinutes: 30
cancelTimeoutInMinutes: 1
templateContext:
outputs:
- output: pipelineArtifact
displayName: '${{ parameters.vsixName }}'
targetPath: $(Build.ArtifactStagingDirectory)\vsix
artifactName: vsix

steps:
- checkout: self

- task: UseNode@1
displayName: Use Node 18.x
inputs:
version: 18.x

- task: Npm@0
displayName: Install vsce
inputs:
arguments: --global @vscode/vsce

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: Use Yarn 1.x

- task: CmdLine@1
displayName: Create Staging Directory
inputs:
filename: mkdir
arguments: $(Build.ArtifactStagingDirectory)\vsix

- task: CmdLine@1
displayName: Run VSCE to package vsix
inputs:
filename: vsce
arguments: package --yarn -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}
workingFolder: $(Build.SourcesDirectory)\${{ parameters.srcDir }}

- task: Npm@0
displayName: Uninstall vsce
inputs:
command: uninstall
arguments: --global @vscode/vsce
43 changes: 43 additions & 0 deletions Build/publish/cpptools_extension_pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: $(Date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none

resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
pipelines:
- pipeline: vsixBuild
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-extension-pack'
trigger: true

extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows

stages:
- stage: Validate
jobs:
- template: /Build/publish/jobs_manual_validation.yml@self
parameters:
notifyUsers: $(NotifyUsers)
releaseBuildUrl: $(ReleaseBuildUrl)

- stage: Release
dependsOn: Validate
jobs:
- template: /Build/publish/jobs_publish_vsix.yml@self
parameters:
vsixName: cpptools-extension-pack.vsix

43 changes: 43 additions & 0 deletions Build/publish/cpptools_themes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: $(Date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none

resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
pipelines:
- pipeline: vsixBuild
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-themes'
trigger: true

extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows

stages:
- stage: Validate
jobs:
- template: /Build/publish/jobs_manual_validation.yml@self
parameters:
notifyUsers: $(NotifyUsers)
releaseBuildUrl: $(ReleaseBuildUrl)

- stage: Release
dependsOn: Validate
jobs:
- template: /Build/publish/jobs_publish_vsix.yml@self
parameters:
vsixName: cpptools-themes.vsix

19 changes: 19 additions & 0 deletions Build/publish/jobs_manual_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
parameters:
- name: notifyUsers
type: string
default: ''
- name: releaseBuildUrl
type: string
default: ''

jobs:
- job: WaitForValidation
displayName: Wait for VSIX validation
pool: server
steps:
- task: ManualValidation@0
displayName: "Manual Validation"
inputs:
notifyUsers: $(notifyUsers)
instructions: |
Download and test the vsix from the latest release build: $(releaseBuildUrl)
44 changes: 44 additions & 0 deletions Build/publish/jobs_publish_vsix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
parameters:
- name: vsixName
type: string
default: ''

jobs:
- job: Publish
displayName: Publish to Marketplace
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
pipeline: vsixBuild
artifactName: vsix
targetPath: $(Build.StagingDirectory)\vsix

steps:
- task: NodeTool@0
displayName: Use Node 18.x
inputs:
versionSpec: 18.x

- task: Npm@0
displayName: Install vsce
inputs:
arguments: --global @vscode/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.StagingDirectory)\vsix\${{ parameters.vsixName }}
displayName: Publish to Marketplace
env:
VSCE_PAT: $(AAD_TOKEN)

0 comments on commit 06ed838

Please sign in to comment.