Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/linux/product-build-linux-cli.yml
4772 views
1
parameters:
2
- name: VSCODE_ARCH
3
type: string
4
- name: VSCODE_CHECK_ONLY
5
type: boolean
6
default: false
7
- name: VSCODE_QUALITY
8
type: string
9
10
jobs:
11
- job: LinuxCLI_${{ parameters.VSCODE_ARCH }}
12
displayName: Linux (${{ upper(parameters.VSCODE_ARCH) }})
13
timeoutInMinutes: 60
14
pool:
15
name: 1es-ubuntu-22.04-x64
16
os: linux
17
variables:
18
VSCODE_ARCH: ${{ parameters.VSCODE_ARCH }}
19
templateContext:
20
outputs:
21
- ${{ if not(parameters.VSCODE_CHECK_ONLY) }}:
22
- output: pipelineArtifact
23
targetPath: $(Build.ArtifactStagingDirectory)/vscode_cli_linux_$(VSCODE_ARCH)_cli.tar.gz
24
artifactName: vscode_cli_linux_$(VSCODE_ARCH)_cli
25
displayName: Publish vscode_cli_linux_$(VSCODE_ARCH)_cli artifact
26
sbomBuildDropPath: $(Build.ArtifactStagingDirectory)/cli
27
sbomPackageName: "VS Code Linux $(VSCODE_ARCH) CLI"
28
sbomPackageVersion: $(Build.SourceVersion)
29
steps:
30
- template: ../common/checkout.yml@self
31
32
- task: NodeTool@0
33
inputs:
34
versionSource: fromFile
35
versionFilePath: .nvmrc
36
37
- template: ../cli/cli-apply-patches.yml@self
38
39
- task: Npm@1
40
displayName: Download openssl prebuilt
41
inputs:
42
command: custom
43
customCommand: pack @vscode-internal/openssl-prebuilt@0.0.11
44
customRegistry: useFeed
45
customFeed: "Monaco/openssl-prebuilt"
46
workingDir: $(Build.ArtifactStagingDirectory)
47
48
- script: |
49
set -e
50
mkdir $(Build.ArtifactStagingDirectory)/openssl
51
tar -xvzf $(Build.ArtifactStagingDirectory)/vscode-internal-openssl-prebuilt-0.0.11.tgz --strip-components=1 --directory=$(Build.ArtifactStagingDirectory)/openssl
52
displayName: Extract openssl prebuilt
53
54
- script: node build/setup-npm-registry.ts $NPM_REGISTRY build
55
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
56
displayName: Setup NPM Registry
57
58
- script: |
59
set -e
60
# Set the private NPM registry to the global npmrc file
61
# so that authentication works for subfolders like build/, remote/, extensions/ etc
62
# which does not have their own .npmrc file
63
npm config set registry "$NPM_REGISTRY"
64
echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)"
65
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
66
displayName: Setup NPM
67
68
- task: npmAuthenticate@0
69
inputs:
70
workingFile: $(NPMRC_PATH)
71
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
72
displayName: Setup NPM Authentication
73
74
- script: |
75
set -e
76
77
for i in {1..5}; do # try 5 times
78
npm ci && break
79
if [ $i -eq 5 ]; then
80
echo "Npm install failed too many times" >&2
81
exit 1
82
fi
83
echo "Npm install failed $i, trying again..."
84
done
85
workingDirectory: build
86
env:
87
GITHUB_TOKEN: "$(github-distro-mixin-password)"
88
displayName: Install build dependencies
89
90
- script: |
91
set -e
92
mkdir -p $(Build.SourcesDirectory)/.build
93
displayName: Create .build folder for misc dependencies
94
95
- template: ../cli/install-rust-posix.yml@self
96
parameters:
97
targets:
98
- ${{ if eq(parameters.VSCODE_ARCH, 'x64') }}:
99
- x86_64-unknown-linux-gnu
100
- ${{ if eq(parameters.VSCODE_ARCH, 'arm64') }}:
101
- aarch64-unknown-linux-gnu
102
- ${{ if eq(parameters.VSCODE_ARCH, 'armhf') }}:
103
- armv7-unknown-linux-gnueabihf
104
105
- ${{ if eq(parameters.VSCODE_ARCH, 'x64') }}:
106
- template: ../cli/cli-compile.yml@self
107
parameters:
108
VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}
109
VSCODE_CLI_TARGET: x86_64-unknown-linux-gnu
110
VSCODE_CLI_ARTIFACT: vscode_cli_linux_x64_cli
111
VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }}
112
VSCODE_CLI_ENV:
113
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-linux/lib
114
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/x64-linux/include
115
SYSROOT_ARCH: amd64
116
117
- ${{ if eq(parameters.VSCODE_ARCH, 'arm64') }}:
118
- template: ../cli/cli-compile.yml@self
119
parameters:
120
VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}
121
VSCODE_CLI_TARGET: aarch64-unknown-linux-gnu
122
VSCODE_CLI_ARTIFACT: vscode_cli_linux_arm64_cli
123
VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }}
124
VSCODE_CLI_ENV:
125
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-linux/lib
126
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm64-linux/include
127
SYSROOT_ARCH: arm64
128
129
- ${{ if eq(parameters.VSCODE_ARCH, 'armhf') }}:
130
- template: ../cli/cli-compile.yml@self
131
parameters:
132
VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}
133
VSCODE_CLI_TARGET: armv7-unknown-linux-gnueabihf
134
VSCODE_CLI_ARTIFACT: vscode_cli_linux_armhf_cli
135
VSCODE_CHECK_ONLY: ${{ parameters.VSCODE_CHECK_ONLY }}
136
VSCODE_CLI_ENV:
137
OPENSSL_LIB_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm-linux/lib
138
OPENSSL_INCLUDE_DIR: $(Build.ArtifactStagingDirectory)/openssl/arm-linux/include
139
SYSROOT_ARCH: armhf
140
141