Welcome to mirror list, hosted at ThFree Co, Russian Federation.

product-build-win32.yml « win32 « azure-pipelines « build - github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 41f0a8da8c2dc74d7ee145291453758f77ed4f24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
parameters:
  - name: VSCODE_PUBLISH
    type: boolean
  - name: VSCODE_QUALITY
    type: string
  - name: VSCODE_RUN_UNIT_TESTS
    type: boolean
  - name: VSCODE_RUN_INTEGRATION_TESTS
    type: boolean
  - name: VSCODE_RUN_SMOKE_TESTS
    type: boolean

steps:
  - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
    - checkout: self
      fetchDepth: 1
      retryCountOnTaskFailure: 3

  - task: NodeTool@0
    inputs:
      versionSpec: "16.x"

  - task: UsePythonVersion@0
    inputs:
      versionSpec: "3.x"
      addToPath: true

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - task: AzureKeyVault@1
      displayName: "Azure Key Vault: Get Secrets"
      inputs:
        azureSubscription: "vscode-builds-subscription"
        KeyVaultName: vscode
        SecretsFilter: "github-distro-mixin-password,ESRP-PKI,esrp-aad-username,esrp-aad-password"

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - task: DownloadPipelineArtifact@2
      inputs:
        artifact: Compilation
        path: $(Build.ArtifactStagingDirectory)
      displayName: Download compilation output

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - task: ExtractFiles@1
      displayName: Extract compilation output
      inputs:
        archiveFilePatterns: "$(Build.ArtifactStagingDirectory)/compilation.tar.gz"
        cleanDestinationFolder: false

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        "machine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII

        exec { git config user.email "vscode@microsoft.com" }
        exec { git config user.name "VSCode" }
      displayName: Prepare tooling

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"

        exec { git fetch https://github.com/$(VSCODE_MIXIN_REPO).git $(VSCODE_DISTRO_REF) }
        Write-Host "##vso[task.setvariable variable=VSCODE_DISTRO_COMMIT;]$(git rev-parse FETCH_HEAD)"
        exec { git checkout FETCH_HEAD }
      condition: and(succeeded(), ne(variables.VSCODE_DISTRO_REF, ' '))
      displayName: Checkout override commit

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        exec { git pull --no-rebase https://github.com/$(VSCODE_MIXIN_REPO).git $(node -p "require('./package.json').distro") }
      displayName: Merge distro

  - powershell: |
      if (!(Test-Path ".build")) { New-Item -Path ".build" -ItemType Directory }
      "$(VSCODE_ARCH)" | Out-File -Encoding ascii -NoNewLine .build\arch
      "$env:ENABLE_TERRAPIN" | Out-File -Encoding ascii -NoNewLine .build\terrapin
      node build/azure-pipelines/common/computeNodeModulesCacheKey.js > .build/yarnlockhash
    displayName: Prepare yarn cache flags

  - task: Cache@2
    inputs:
      key: "nodeModules | $(Agent.OS) | .build/arch, .build/terrapin, .build/yarnlockhash"
      path: .build/node_modules_cache
      cacheHitVar: NODE_MODULES_RESTORED
    displayName: Restore node_modules cache

  - powershell: |
      . build/azure-pipelines/win32/exec.ps1
      $ErrorActionPreference = "Stop"
      exec { 7z.exe x .build/node_modules_cache/cache.7z -aos }
    condition: and(succeeded(), eq(variables.NODE_MODULES_RESTORED, 'true'))
    displayName: Extract node_modules cache

  - powershell: |
      . build/azure-pipelines/win32/exec.ps1
      $ErrorActionPreference = "Stop"
      exec { npx https://aka.ms/enablesecurefeed standAlone }
    timeoutInMinutes: 5
    retryCountOnTaskFailure: 3
    condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), eq(variables['ENABLE_TERRAPIN'], 'true'))
    displayName: Switch to Terrapin packages

  - powershell: |
      . build/azure-pipelines/win32/exec.ps1
      . build/azure-pipelines/win32/retry.ps1
      $ErrorActionPreference = "Stop"
      $env:npm_config_arch="$(VSCODE_ARCH)"
      $env:CHILD_CONCURRENCY="1"
      retry { exec { yarn --frozen-lockfile --check-files } }
    env:
      ELECTRON_SKIP_BINARY_DOWNLOAD: 1
      PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
      GITHUB_TOKEN: "$(github-distro-mixin-password)"
    displayName: Install dependencies
    condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))

  - powershell: |
      . build/azure-pipelines/win32/exec.ps1
      $ErrorActionPreference = "Stop"
      exec { node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt }
      exec { mkdir -Force .build/node_modules_cache }
      exec { 7z.exe a .build/node_modules_cache/cache.7z -mx3 `@.build/node_modules_list.txt }
    condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
    displayName: Create node_modules archive

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        exec { node build/azure-pipelines/mixin }
      displayName: Mix in quality

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        exec { node build\lib\policies }
      displayName: Generate Group Policy definitions

  - ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
        exec { yarn gulp "transpile-client" "transpile-extensions" }
      displayName: Transpile

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
        exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-min-ci" }
        echo "##vso[task.setvariable variable=CodeSigningFolderPath]$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)"
      displayName: Build

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
        exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-inno-updater" }
      displayName: Prepare Package

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        exec { node build/azure-pipelines/mixin --server }
      displayName: Mix in quality
      condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))

  - ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        $env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
        exec { yarn gulp "vscode-reh-win32-$(VSCODE_ARCH)-min-ci" }
        exec { yarn gulp "vscode-reh-web-win32-$(VSCODE_ARCH)-min-ci" }
        echo "##vso[task.setvariable variable=CodeSigningFolderPath]$(CodeSigningFolderPath),$(agent.builddirectory)/vscode-reh-win32-$(VSCODE_ARCH)"
      displayName: Build Server
      condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))

  - ${{ if or(eq(parameters.VSCODE_RUN_UNIT_TESTS, true), eq(parameters.VSCODE_RUN_INTEGRATION_TESTS, true), eq(parameters.VSCODE_RUN_SMOKE_TESTS, true)) }}:
    - template: product-build-win32-test.yml
      parameters:
        VSCODE_QUALITY: ${{ parameters.VSCODE_QUALITY }}
        VSCODE_RUN_UNIT_TESTS: ${{ parameters.VSCODE_RUN_UNIT_TESTS }}
        VSCODE_RUN_INTEGRATION_TESTS: ${{ parameters.VSCODE_RUN_INTEGRATION_TESTS }}
        VSCODE_RUN_SMOKE_TESTS: ${{ parameters.VSCODE_RUN_SMOKE_TESTS }}

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - task: UseDotNet@2
      inputs:
        version: 3.x
      condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - task: EsrpClientTool@1
      displayName: Download ESRPClient

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        $EsrpClientTool = (gci -directory -filter EsrpClientTool_* $(Agent.RootDirectory)\_tasks | Select-Object -last 1).FullName
        $EsrpCliZip = (gci -recurse -filter esrpcli.*.zip $EsrpClientTool | Select-Object -last 1).FullName
        mkdir -p $(Agent.TempDirectory)\esrpcli
        Expand-Archive -Path $EsrpCliZip -DestinationPath $(Agent.TempDirectory)\esrpcli
        $EsrpCliDllPath = (gci -recurse -filter esrpcli.dll $(Agent.TempDirectory)\esrpcli | Select-Object -last 1).FullName
        echo "##vso[task.setvariable variable=EsrpCliDllPath]$EsrpCliDllPath"
      displayName: Find ESRP CLI

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        exec { node build\azure-pipelines\common\sign $env:EsrpCliDllPath windows $(ESRP-PKI) $(esrp-aad-username) $(esrp-aad-password) $(CodeSigningFolderPath) '*.dll,*.exe,*.node' }
      displayName: Codesign

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-archive" }
      displayName: Package archive

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        $env:ESRPPKI = "$(ESRP-PKI)"
        $env:ESRPAADUsername = "$(esrp-aad-username)"
        $env:ESRPAADPassword = "$(esrp-aad-password)"
        exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-system-setup" --sign }
        exec { yarn gulp "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign }
      displayName: Package setups

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - powershell: |
        . build/azure-pipelines/win32/exec.ps1
        $ErrorActionPreference = "Stop"
        .\build\azure-pipelines\win32\prepare-publish.ps1
      displayName: Publish

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
      displayName: Generate SBOM (client)
      inputs:
        BuildDropPath: $(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)
        PackageName: Visual Studio Code

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - publish: $(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)/_manifest
      displayName: Publish SBOM (client)
      artifact: vscode_client_win32_$(VSCODE_ARCH)_sbom

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
      displayName: Generate SBOM (server)
      inputs:
        BuildDropPath: $(agent.builddirectory)/vscode-server-win32-$(VSCODE_ARCH)
        PackageName: Visual Studio Code Server
      condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - publish: $(agent.builddirectory)/vscode-server-win32-$(VSCODE_ARCH)/_manifest
      displayName: Publish SBOM (server)
      artifact: vscode_server_win32_$(VSCODE_ARCH)_sbom
      condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\archive\$(ARCHIVE_NAME)
      artifact: vscode_client_win32_$(VSCODE_ARCH)_archive
      displayName: Publish archive

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\system-setup\$(SYSTEM_SETUP_NAME)
      artifact: vscode_client_win32_$(VSCODE_ARCH)_setup
      displayName: Publish system setup

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\user-setup\$(USER_SETUP_NAME)
      artifact: vscode_client_win32_$(VSCODE_ARCH)_user-setup
      displayName: Publish user setup
      condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - publish: $(System.DefaultWorkingDirectory)\.build\vscode-server-win32-$(VSCODE_ARCH).zip
      artifact: vscode_server_win32_$(VSCODE_ARCH)_archive
      displayName: Publish server archive
      condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))

  - ${{ if eq(parameters.VSCODE_PUBLISH, true) }}:
    - publish: $(System.DefaultWorkingDirectory)\.build\vscode-server-win32-$(VSCODE_ARCH)-web.zip
      artifact: vscode_web_win32_$(VSCODE_ARCH)_archive
      displayName: Publish web server archive
      condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))