Path: blob/main/build/azure-pipelines/linux/product-build-linux-cli.yml
4772 views
parameters:1- name: VSCODE_ARCH2type: string3- name: VSCODE_CHECK_ONLY4type: boolean5default: false6- name: VSCODE_QUALITY7type: string89jobs:10- job: LinuxCLI_${{ parameters.VSCODE_ARCH }}11displayName: Linux (${{ upper(parameters.VSCODE_ARCH) }})12timeoutInMinutes: 6013pool:14name: 1es-ubuntu-22.04-x6415os: linux16variables:17VSCODE_ARCH: ${{ parameters.VSCODE_ARCH }}18templateContext:19outputs:20- ${{ if not(parameters.VSCODE_CHECK_ONLY) }}:21- output: pipelineArtifact22targetPath: $(Build.ArtifactStagingDirectory)/vscode_cli_linux_$(VSCODE_ARCH)_cli.tar.gz23artifactName: vscode_cli_linux_$(VSCODE_ARCH)_cli24displayName: Publish vscode_cli_linux_$(VSCODE_ARCH)_cli artifact25sbomBuildDropPath: $(Build.ArtifactStagingDirectory)/cli26sbomPackageName: "VS Code Linux $(VSCODE_ARCH) CLI"27sbomPackageVersion: $(Build.SourceVersion)28steps:29- template: ../common/checkout.yml@self3031- task: NodeTool@032inputs:33versionSource: fromFile34versionFilePath: .nvmrc3536- template: ../cli/cli-apply-patches.yml@self3738- task: Npm@139displayName: Download openssl prebuilt40inputs:41command: custom42customCommand: pack @vscode-internal/openssl-prebuilt@0.0.1143customRegistry: useFeed44customFeed: "Monaco/openssl-prebuilt"45workingDir: $(Build.ArtifactStagingDirectory)4647- script: |48set -e49mkdir $(Build.ArtifactStagingDirectory)/openssl50tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.11.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl51displayName: Extract openssl prebuilt5253- script: node build/setup-npm-registry.ts $NPM_REGISTRY build54condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))55displayName: Setup NPM Registry5657- script: |58set -e59# Set the private NPM registry to the global npmrc file60# so that authentication works for subfolders like build/, remote/, extensions/ etc61# which does not have their own .npmrc file62npm config set registry "$NPM_REGISTRY"63echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)"64condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))65displayName: Setup NPM6667- task: npmAuthenticate@068inputs:69workingFile: $(NPMRC_PATH)70condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))71displayName: Setup NPM Authentication7273- script: |74set -e7576for i in {1..5}; do # try 5 times77npm ci && break78if [ $i -eq 5 ]; then79echo "Npm install failed too many times" >&280exit 181fi82echo "Npm install failed $i, trying again..."83done84workingDirectory: build85env:86GITHUB_TOKEN: "$(github-distro-mixin-password)"87displayName: Install build dependencies8889- script: |90set -e91mkdir -p $(Build.SourcesDirectory)/.build92displayName: Create .build folder for misc dependencies9394- template: ../cli/install-rust-posix.yml@self95parameters:96targets:97- ${{ if eq(parameters.VSCODE_ARCH, 'x64') }}:98- x86_64-unknown-linux-gnu99- ${{ if eq(parameters.VSCODE_ARCH, 'arm64') }}:100- aarch64-unknown-linux-gnu101- ${{ if eq(parameters.VSCODE_ARCH, 'armhf') }}:102- armv7-unknown-linux-gnueabihf103104- ${{ if eq(parameters.VSCODE_ARCH, 'x64') }}:105- template: ../cli/cli-compile.yml@self106parameters:107VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}108VSCODE_CLI_TARGET: x86_64-unknown-linux-gnu109VSCODE_CLI_ARTIFACT: vscode_cli_linux_x64_cli110VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }}111VSCODE_CLI_ENV:112OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-linux/lib113OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-linux/include114SYSROOT_ARCH: amd64115116- ${{ if eq(parameters.VSCODE_ARCH, 'arm64') }}:117- template: ../cli/cli-compile.yml@self118parameters:119VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}120VSCODE_CLI_TARGET: aarch64-unknown-linux-gnu121VSCODE_CLI_ARTIFACT: vscode_cli_linux_arm64_cli122VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }}123VSCODE_CLI_ENV:124OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-linux/lib125OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-linux/include126SYSROOT_ARCH: arm64127128- ${{ if eq(parameters.VSCODE_ARCH, 'armhf') }}:129- template: ../cli/cli-compile.yml@self130parameters:131VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}132VSCODE_CLI_TARGET: armv7-unknown-linux-gnueabihf133VSCODE_CLI_ARTIFACT: vscode_cli_linux_armhf_cli134VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }}135VSCODE_CLI_ENV:136OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm-linux/lib137OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm-linux/include138SYSROOT_ARCH: armhf139140141