From 2c99e575cdab4dc46f661ebc712c997c8ffd2033 Mon Sep 17 00:00:00 2001 From: dileepyavan <52841896+dileepyavan@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:17:17 -0700 Subject: [PATCH] Parameterizing TSA upload stage (#319659) * Parameterizing TSA upload stage * updates * updates --- .../product-build optional-TSA.yml | 799 ++++++++++++++++++ 1 file changed, 799 insertions(+) create mode 100644 build/azure-pipelines/product-build optional-TSA.yml diff --git a/build/azure-pipelines/product-build optional-TSA.yml b/build/azure-pipelines/product-build optional-TSA.yml new file mode 100644 index 00000000000..cf14ea33b82 --- /dev/null +++ b/build/azure-pipelines/product-build optional-TSA.yml @@ -0,0 +1,799 @@ +pr: none + +schedules: + - cron: "0 5 * * Mon-Fri" + displayName: Mon-Fri at 5:00 UTC (build, publish, and release) + branches: + include: + - main + - cron: "0 11 * * Mon-Fri" + displayName: Mon-Fri at 11:00 UTC (build, and publish) + branches: + include: + - main + - cron: "0 17 * * Mon-Fri" + displayName: Mon-Fri at 17:00 UTC (build, publish, and release) + branches: + include: + - main + - cron: "0 23 * * Mon-Fri" + displayName: Mon-Fri at 23:00 UTC (build, and publish) + branches: + include: + - main + +trigger: + batch: true + branches: + include: ["main", "release/*"] + +parameters: + - name: VSCODE_QUALITY + displayName: Quality + type: string + default: insider + values: + - exploration + - insider + - stable + - name: VSCODE_BUILD_TYPE + displayName: Build Type + type: string + default: Product + values: + - Product + - CI + - name: NPM_REGISTRY + displayName: "Custom NPM Registry" + type: string + default: 'https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/' + - name: CARGO_REGISTRY + displayName: "Custom Cargo Registry" + type: string + default: 'sparse+https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/Cargo/index/' + - name: VSCODE_BUILD_WIN32 + displayName: "🎯 Windows x64" + type: boolean + default: true + - name: VSCODE_BUILD_WIN32_ARM64 + displayName: "🎯 Windows arm64" + type: boolean + default: true + - name: VSCODE_BUILD_LINUX + displayName: "🎯 Linux x64" + type: boolean + default: true + - name: VSCODE_BUILD_LINUX_SNAP + displayName: "🎯 Linux x64 Snap" + type: boolean + default: true + - name: VSCODE_BUILD_LINUX_ARM64 + displayName: "🎯 Linux arm64" + type: boolean + default: true + - name: VSCODE_BUILD_LINUX_ARMHF + displayName: "🎯 Linux armhf" + type: boolean + default: true + - name: VSCODE_BUILD_ALPINE + displayName: "🎯 Alpine x64" + type: boolean + default: true + - name: VSCODE_BUILD_ALPINE_ARM64 + displayName: "🎯 Alpine arm64" + type: boolean + default: true + - name: VSCODE_BUILD_MACOS + displayName: "🎯 macOS x64" + type: boolean + default: true + - name: VSCODE_BUILD_MACOS_ARM64 + displayName: "🎯 macOS arm64" + type: boolean + default: true + - name: VSCODE_BUILD_MACOS_UNIVERSAL + displayName: "🎯 macOS universal" + type: boolean + default: true + - name: VSCODE_BUILD_WEB + displayName: "🎯 Web" + type: boolean + default: true + - name: VSCODE_PUBLISH + displayName: "Publish to builds.code.visualstudio.com" + type: boolean + default: true + - name: VSCODE_RELEASE + displayName: "Release build if successful" + type: boolean + default: false + - name: VSCODE_STEP_ON_IT + displayName: "Skip tests" + type: boolean + default: false + - name: VSCODE_RUN_TSA + displayName: "Run TSA checks" + type: boolean + default: false + +variables: + - name: VSCODE_PRIVATE_BUILD + value: ${{ ne(variables['Build.Repository.Uri'], 'https://github.com/microsoft/vscode.git') }} + - name: NPM_REGISTRY + value: ${{ parameters.NPM_REGISTRY }} + - name: CARGO_REGISTRY + value: ${{ parameters.CARGO_REGISTRY }} + - name: VSCODE_QUALITY + value: ${{ parameters.VSCODE_QUALITY }} + - name: VSCODE_BUILD_STAGE_WINDOWS + value: ${{ or(eq(parameters.VSCODE_BUILD_WIN32, true), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }} + - name: VSCODE_BUILD_STAGE_LINUX + value: ${{ or(eq(parameters.VSCODE_BUILD_LINUX, true), eq(parameters.VSCODE_BUILD_LINUX_SNAP, true), eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true)) }} + - name: VSCODE_BUILD_STAGE_ALPINE + value: ${{ or(eq(parameters.VSCODE_BUILD_ALPINE, true), eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true)) }} + - name: VSCODE_BUILD_STAGE_MACOS + value: ${{ or(eq(parameters.VSCODE_BUILD_MACOS, true), eq(parameters.VSCODE_BUILD_MACOS_ARM64, true)) }} + - name: VSCODE_BUILD_STAGE_WEB + value: ${{ eq(parameters.VSCODE_BUILD_WEB, true) }} + - name: VSCODE_CIBUILD + value: ${{ or(in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), eq(parameters.VSCODE_BUILD_TYPE, 'CI')) }} + - name: VSCODE_PUBLISH + value: ${{ and(eq(parameters.VSCODE_PUBLISH, true), eq(variables.VSCODE_CIBUILD, false)) }} + - name: VSCODE_SCHEDULEDBUILD + value: ${{ eq(variables['Build.Reason'], 'Schedule') }} + - name: VSCODE_PUBLISH_COUNTER_PREFIX + value: $[format('{0:yyyyMMdd}-{1}-{2}-{3}', pipeline.startTime, variables['VSCODE_QUALITY'], variables['VSCODE_PUBLISH'], variables['Build.SourceBranch'])] + - name: VSCODE_PUBLISH_COUNTER + value: $[counter(variables['VSCODE_PUBLISH_COUNTER_PREFIX'], 1)] + - name: VSCODE_STEP_ON_IT + value: ${{ eq(parameters.VSCODE_STEP_ON_IT, true) }} + - name: VSCODE_BUILD_MACOS_UNIVERSAL + value: ${{ and(eq(parameters.VSCODE_BUILD_MACOS, true), eq(parameters.VSCODE_BUILD_MACOS_ARM64, true), eq(parameters.VSCODE_BUILD_MACOS_UNIVERSAL, true)) }} + - name: VSCODE_STAGING_BLOB_STORAGE_ACCOUNT_NAME + value: vscodeesrp + - name: PRSS_CDN_URL + value: https://vscode.download.prss.microsoft.com/dbazure/download + - name: VSCODE_ESRP_SERVICE_CONNECTION_ID + value: fe07e6ce-6ffb-4df9-8d27-d129523a3f3e + - name: VSCODE_ESRP_TENANT_ID + value: 975f013f-7f24-47e8-a7d3-abc4752bf346 + - name: VSCODE_ESRP_CLIENT_ID + value: 4ac7ed59-b5e9-4f66-9c30-8d1afa72d32d + - name: ESRP_TENANT_ID + value: 975f013f-7f24-47e8-a7d3-abc4752bf346 + - name: ESRP_CLIENT_ID + value: c24324f7-e65f-4c45-8702-ed2d4c35df99 + - name: AZURE_DOCUMENTDB_ENDPOINT + value: https://vscode.documents.azure.com/ + - name: VSCODE_MIXIN_REPO + value: microsoft/vscode-distro + - name: skipComponentGovernanceDetection + value: true + - name: ComponentDetection.Timeout + value: 600 + - name: Codeql.SkipTaskAutoInjection + value: true + - name: ARTIFACT_PREFIX + value: '' + +name: "$(Date:yyyyMMdd).$(Rev:r) (${{ parameters.VSCODE_QUALITY }})" + +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + parameters: + sdl: + tsa: + enabled: ${{ parameters.VSCODE_RUN_TSA }} + configFile: $(Build.SourcesDirectory)/build/azure-pipelines/config/tsaoptions.json + binskim: + analyzeTargetGlob: '+:file|$(Agent.BuildDirectory)/VSCode-*/**/*.exe;+:file|$(Agent.BuildDirectory)/VSCode-*/**/*.dll;+:file|$(Agent.BuildDirectory)/VSCode-*/**/*.node;-:file|$(Agent.BuildDirectory)/VSCode-*/**/resources/**/*.exe;-:file|$(Agent.BuildDirectory)/VSCode-*/**/resources/**/*.node;-:file|$(Build.SourcesDirectory)/.build/**/system-setup/VSCodeSetup*.exe;-:file|$(Build.SourcesDirectory)/.build/**/user-setup/VSCodeUserSetup*.exe' + codeql: + runSourceLanguagesInSourceAnalysis: true + compiled: + enabled: false + justificationForDisabling: "CodeQL breaks ESRP CodeSign on macOS (ICM #520035761, githubcustomers/microsoft-codeql-support#198)" + credscan: + suppressionsFile: $(Build.SourcesDirectory)/build/azure-pipelines/config/CredScanSuppressions.json + eslint: + enabled: true + enableExclusions: true + exclusionsFilePath: $(Build.SourcesDirectory)/.eslint-ignore + sourceAnalysisPool: 1es-windows-2022-x64 + createAdoIssuesForJustificationsForDisablement: false + containers: + ubuntu-2004-arm64: + image: onebranch.azurecr.io/linux/ubuntu-2004-arm64:latest + stages: + + - stage: Quality + dependsOn: [] + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + jobs: + - template: build/azure-pipelines/product-quality-checks.yml@self + + - stage: Copilot + dependsOn: [] + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + jobs: + - template: build/azure-pipelines/product-copilot.yml@self + parameters: + VSCODE_PUBLISH: ${{ variables.VSCODE_PUBLISH }} + VSCODE_RELEASE: ${{ parameters.VSCODE_RELEASE }} + + - ${{ if eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true) }}: + - stage: Windows + dependsOn: [] + pool: + name: 1es-windows-2022-x64 + os: windows + jobs: + - ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}: + - template: build/azure-pipelines/win32/product-build-win32-cli.yml@self + parameters: + VSCODE_ARCH: x64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - template: build/azure-pipelines/win32/product-build-win32-cli.yml@self + parameters: + VSCODE_ARCH: arm64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if eq(variables['VSCODE_CIBUILD'], true) }}: + - template: build/azure-pipelines/win32/product-build-win32-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_TEST_SUITE: Electron + - template: build/azure-pipelines/win32/product-build-win32-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_TEST_SUITE: Browser + - template: build/azure-pipelines/win32/product-build-win32-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_TEST_SUITE: Remote + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_WIN32, true)) }}: + - template: build/azure-pipelines/win32/product-build-win32.yml@self + parameters: + VSCODE_ARCH: x64 + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_RUN_ELECTRON_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + VSCODE_RUN_BROWSER_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + VSCODE_RUN_REMOTE_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}: + - template: build/azure-pipelines/win32/product-build-win32.yml@self + parameters: + VSCODE_ARCH: arm64 + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if eq(variables['VSCODE_BUILD_STAGE_LINUX'], true) }}: + - stage: Linux + dependsOn: [] + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + jobs: + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/linux/product-build-linux-cli.yml@self + parameters: + VSCODE_ARCH: x64 + VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true)) }}: + - template: build/azure-pipelines/linux/product-build-linux-cli.yml@self + parameters: + VSCODE_ARCH: arm64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true)) }}: + - template: build/azure-pipelines/linux/product-build-linux-cli.yml@self + parameters: + VSCODE_ARCH: armhf + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if eq(variables['VSCODE_CIBUILD'], true) }}: + - template: build/azure-pipelines/linux/product-build-linux-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_TEST_SUITE: Electron + - template: build/azure-pipelines/linux/product-build-linux-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_TEST_SUITE: Browser + - template: build/azure-pipelines/linux/product-build-linux-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_TEST_SUITE: Remote + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), or(eq(parameters.VSCODE_BUILD_LINUX, true), eq(parameters.VSCODE_BUILD_LINUX_SNAP, true))) }}: + - template: build/azure-pipelines/linux/product-build-linux.yml@self + parameters: + NPM_ARCH: x64 + VSCODE_ARCH: x64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_RUN_ELECTRON_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + VSCODE_RUN_BROWSER_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + VSCODE_RUN_REMOTE_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + VSCODE_BUILD_LINUX_SNAP: ${{ parameters.VSCODE_BUILD_LINUX_SNAP }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true)) }}: + - template: build/azure-pipelines/linux/product-build-linux.yml@self + parameters: + NPM_ARCH: arm + VSCODE_ARCH: armhf + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_LINUX_ARM64, true)) }}: + - template: build/azure-pipelines/linux/product-build-linux.yml@self + parameters: + NPM_ARCH: arm64 + VSCODE_ARCH: arm64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(variables['VSCODE_BUILD_STAGE_ALPINE'], true)) }}: + - stage: Alpine + dependsOn: [] + jobs: + - ${{ if eq(parameters.VSCODE_BUILD_ALPINE, true) }}: + - template: build/azure-pipelines/alpine/product-build-alpine.yml@self + parameters: + VSCODE_ARCH: x64 + - template: build/azure-pipelines/alpine/product-build-alpine-cli.yml@self + parameters: + VSCODE_ARCH: x64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + - ${{ if eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true) }}: + - template: build/azure-pipelines/alpine/product-build-alpine.yml@self + parameters: + VSCODE_ARCH: arm64 + - template: build/azure-pipelines/alpine/product-build-alpine-cli.yml@self + parameters: + VSCODE_ARCH: arm64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if eq(variables['VSCODE_BUILD_STAGE_MACOS'], true) }}: + - stage: macOS + dependsOn: [] + pool: + name: AcesShared + os: macOS + demands: + - ImageOverride -equals ACES_VM_SharedPool_Sequoia + variables: + BUILDSECMON_OPT_IN: true + jobs: + - ${{ if eq(parameters.VSCODE_BUILD_MACOS, true) }}: + - template: build/azure-pipelines/darwin/product-build-darwin-cli.yml@self + parameters: + VSCODE_ARCH: x64 + VSCODE_CHECK_ONLY: ${{ variables.VSCODE_CIBUILD }} + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_MACOS_ARM64, true)) }}: + - template: build/azure-pipelines/darwin/product-build-darwin-cli.yml@self + parameters: + VSCODE_ARCH: arm64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + + - ${{ if eq(variables['VSCODE_CIBUILD'], true) }}: + - template: build/azure-pipelines/darwin/product-build-darwin-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_TEST_SUITE: Electron + - template: build/azure-pipelines/darwin/product-build-darwin-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_TEST_SUITE: Browser + - template: build/azure-pipelines/darwin/product-build-darwin-ci.yml@self + parameters: + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_TEST_SUITE: Remote + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_MACOS, true)) }}: + - template: build/azure-pipelines/darwin/product-build-darwin.yml@self + parameters: + VSCODE_ARCH: x64 + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_BUILD_MACOS_ARM64, true)) }}: + - template: build/azure-pipelines/darwin/product-build-darwin.yml@self + parameters: + VSCODE_ARCH: arm64 + VSCODE_CIBUILD: ${{ variables.VSCODE_CIBUILD }} + VSCODE_RUN_ELECTRON_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + VSCODE_RUN_BROWSER_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + VSCODE_RUN_REMOTE_TESTS: ${{ eq(parameters.VSCODE_STEP_ON_IT, false) }} + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(variables['VSCODE_BUILD_MACOS_UNIVERSAL'], true)) }}: + - template: build/azure-pipelines/darwin/product-build-darwin-universal.yml@self + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(variables['VSCODE_BUILD_STAGE_WEB'], true)) }}: + - stage: Web + dependsOn: [] + jobs: + - template: build/azure-pipelines/web/product-build-web.yml@self + + - ${{ if eq(variables['VSCODE_PUBLISH'], true) }}: + - stage: Publish + dependsOn: [] + jobs: + - template: build/azure-pipelines/product-publish.yml@self + parameters: + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} + VSCODE_SCHEDULEDBUILD: ${{ variables.VSCODE_SCHEDULEDBUILD }} + + - ${{ if and(eq(variables['VSCODE_PUBLISH'], 'true'), eq(variables['VSCODE_STEP_ON_IT'], false)) }}: + - stage: SanityTests + displayName: Sanity Tests + dependsOn: + - Publish + variables: + - name: BUILD_COMMIT + value: $(Build.SourceVersion) + - name: BUILD_QUALITY + value: ${{ variables.VSCODE_QUALITY }} + jobs: + # macOS + - ${{ if eq(parameters.VSCODE_BUILD_MACOS, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: macos_x64 + displayName: macOS x64 (no runtime) + poolName: AcesShared + os: macOS + args: --no-detection --grep "darwin-x64" + + - ${{ if eq(parameters.VSCODE_BUILD_MACOS_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: macos_arm64 + displayName: macOS arm64 + poolName: AcesShared + os: macOS + + # Windows + - ${{ if eq(parameters.VSCODE_BUILD_WIN32, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: windows_x64 + displayName: Windows x64 + poolName: 1es-windows-2022-x64 + os: windows + + - ${{ if eq(parameters.VSCODE_BUILD_WIN32_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: windows_arm64 + displayName: Windows arm64 + poolName: 1es-windows-2022-arm64 + os: windows + + # Alpine 3.22 + - ${{ if eq(parameters.VSCODE_BUILD_ALPINE, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: alpine_amd64 + displayName: Alpine 3.22 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: alpine + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_ALPINE_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: alpine_arm64 + displayName: Alpine 3.22 arm64 + poolName: 1es-azure-linux-3-arm64 + container: alpine + arch: arm64 + + # CentOS Stream 9 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: centos_stream9_amd64 + displayName: CentOS Stream 9 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: centos + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: centos_stream9_arm64 + displayName: CentOS Stream 9 arm64 + poolName: 1es-azure-linux-3-arm64 + container: centos + arch: arm64 + + # Debian 11 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: debian_11_amd64 + displayName: Debian 11 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: debian-11 + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: debian_11_arm32 + displayName: Debian 11 arm32 + poolName: 1es-azure-linux-3-arm64 + container: debian-11 + arch: arm + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: debian_11_arm64 + displayName: Debian 11 arm64 + poolName: 1es-azure-linux-3-arm64 + container: debian-11 + arch: arm64 + + # Debian 12 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: debian_12_amd64 + displayName: Debian 12 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: debian-12 + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: debian_12_arm32 + displayName: Debian 12 arm32 + poolName: 1es-azure-linux-3-arm64 + container: debian-12 + arch: arm + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: debian_12_arm64 + displayName: Debian 12 arm64 + poolName: 1es-azure-linux-3-arm64 + container: debian-12 + arch: arm64 + + # Fedora 42 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: fedora_42_amd64 + displayName: Fedora 42 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: fedora-42 + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: fedora_42_arm64 + displayName: Fedora 42 arm64 + poolName: 1es-azure-linux-3-arm64 + container: fedora-42 + arch: arm64 + + # Fedora 43 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: fedora_43_amd64 + displayName: Fedora 43 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: fedora-43 + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: fedora_43_arm64 + displayName: Fedora 43 arm64 + poolName: 1es-azure-linux-3-arm64 + container: fedora-43 + arch: arm64 + + # openSUSE Leap 16.0 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: opensuse_leap_amd64 + displayName: openSUSE Leap 16.0 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: opensuse + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: opensuse_leap_arm64 + displayName: openSUSE Leap 16.0 arm64 + poolName: 1es-azure-linux-3-arm64 + container: opensuse + arch: arm64 + + # Red Hat UBI 9 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: redhat_ubi9_amd64 + displayName: Red Hat UBI 9 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: redhat + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: redhat_ubi9_arm64 + displayName: Red Hat UBI 9 arm64 + poolName: 1es-azure-linux-3-arm64 + container: redhat + arch: arm64 + + # Ubuntu 22.04 Native (Snap coverage) + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: ubuntu_native_x64 + displayName: Ubuntu 22.04 x64 Native + poolName: 1es-ubuntu-22.04-x64 + os: linux + + # Ubuntu 22.04 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: ubuntu_22_04_amd64 + displayName: Ubuntu 22.04 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: ubuntu-22 + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: ubuntu_22_04_arm32 + displayName: Ubuntu 22.04 arm32 + poolName: 1es-azure-linux-3-arm64 + container: ubuntu-22 + arch: arm + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: ubuntu_22_04_arm64 + displayName: Ubuntu 22.04 arm64 + poolName: 1es-azure-linux-3-arm64 + container: ubuntu-22 + arch: arm64 + + # Ubuntu 24.04 + - ${{ if eq(parameters.VSCODE_BUILD_LINUX, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: ubuntu_24_04_amd64 + displayName: Ubuntu 24.04 amd64 + poolName: 1es-ubuntu-22.04-x64 + container: ubuntu-24 + arch: amd64 + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARMHF, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: ubuntu_24_04_arm32 + displayName: Ubuntu 24.04 arm32 + poolName: 1es-azure-linux-3-arm64 + container: ubuntu-24 + arch: arm + + - ${{ if eq(parameters.VSCODE_BUILD_LINUX_ARM64, true) }}: + - template: build/azure-pipelines/common/sanity-tests.yml@self + parameters: + name: ubuntu_24_04_arm64 + displayName: Ubuntu 24.04 arm64 + poolName: 1es-azure-linux-3-arm64 + container: ubuntu-24 + arch: arm64 + + - ${{ if and(parameters.VSCODE_RELEASE, eq(variables['VSCODE_PRIVATE_BUILD'], false), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) }}: + - stage: ApproveRelease + dependsOn: [] # run in parallel to compile stage + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + jobs: + - job: ApproveRelease + displayName: "Approve Release" + variables: + - group: VSCodePeerApproval + - name: skipComponentGovernanceDetection + value: true + + - stage: Release + dependsOn: + - Publish + - ApproveRelease + pool: + name: 1es-ubuntu-22.04-x64 + os: linux + jobs: + - job: ReleaseBuild + displayName: Release Build + steps: + - template: build/azure-pipelines/product-release.yml@self + parameters: + VSCODE_RELEASE: ${{ parameters.VSCODE_RELEASE }} + + - ${{ if eq(variables['VSCODE_CIBUILD'], true) }}: + - stage: node_modules + dependsOn: [] + jobs: + - template: build/azure-pipelines/win32/product-build-win32-node-modules.yml@self + parameters: + VSCODE_ARCH: arm64 + - template: build/azure-pipelines/linux/product-build-linux-node-modules.yml@self + parameters: + NPM_ARCH: arm64 + VSCODE_ARCH: arm64 + - template: build/azure-pipelines/linux/product-build-linux-node-modules.yml@self + parameters: + NPM_ARCH: arm + VSCODE_ARCH: armhf + - template: build/azure-pipelines/alpine/product-build-alpine-node-modules.yml@self + parameters: + VSCODE_ARCH: x64 + - template: build/azure-pipelines/alpine/product-build-alpine-node-modules.yml@self + parameters: + VSCODE_ARCH: arm64 + - template: build/azure-pipelines/darwin/product-build-darwin-node-modules.yml@self + parameters: + VSCODE_ARCH: x64 + - template: build/azure-pipelines/web/product-build-web-node-modules.yml@self + + - ${{ if and(eq(variables['VSCODE_CIBUILD'], false), eq(parameters.VSCODE_RUN_TSA, true)) }}: + - stage: APIScan + dependsOn: [] + pool: + name: 1es-windows-2022-x64 + os: windows + jobs: + - job: WindowsAPIScan + steps: + - template: build/azure-pipelines/win32/sdl-scan-win32.yml@self + parameters: + VSCODE_ARCH: x64 + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}