Path: blob/main/build/azure-pipelines/win32/product-build-win32-node-modules.yml
4772 views
parameters:1- name: VSCODE_ARCH2type: string34jobs:5- job: WindowsNodeModules_${{ parameters.VSCODE_ARCH }}6displayName: Windows (${{ upper(parameters.VSCODE_ARCH) }})7pool:8name: 1es-windows-2022-x649os: windows10timeoutInMinutes: 6011variables:12VSCODE_ARCH: ${{ parameters.VSCODE_ARCH }}13steps:14- template: ../common/checkout.yml@self1516- task: NodeTool@017inputs:18versionSource: fromFile19versionFilePath: .nvmrc2021- task: UsePythonVersion@022inputs:23versionSpec: "3.x"24addToPath: true2526- template: ../distro/download-distro.yml@self2728- task: AzureKeyVault@229displayName: "Azure Key Vault: Get Secrets"30inputs:31azureSubscription: vscode32KeyVaultName: vscode-build-secrets33SecretsFilter: "github-distro-mixin-password"3435- powershell: node build/setup-npm-registry.ts $env:NPM_REGISTRY36condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))37displayName: Setup NPM Registry3839- pwsh: |40mkdir .build -ea 041node build/azure-pipelines/common/computeNodeModulesCacheKey.ts win32 $(VSCODE_ARCH) $(node -p process.arch) > .build/packagelockhash42displayName: Prepare node_modules cache key4344- task: Cache@245inputs:46key: '"node_modules" | .build/packagelockhash'47path: .build/node_modules_cache48cacheHitVar: NODE_MODULES_RESTORED49displayName: Restore node_modules cache5051- powershell: |52. build/azure-pipelines/win32/exec.ps153$ErrorActionPreference = "Stop"54# Set the private NPM registry to the global npmrc file55# so that authentication works for subfolders like build/, remote/, extensions/ etc56# which does not have their own .npmrc file57exec { npm config set registry "$env:NPM_REGISTRY" }58$NpmrcPath = (npm config get userconfig)59echo "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath"60condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))61displayName: Setup NPM6263- task: npmAuthenticate@064inputs:65workingFile: $(NPMRC_PATH)66condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))67displayName: Setup NPM Authentication6869- powershell: |70. build/azure-pipelines/win32/exec.ps171$ErrorActionPreference = "Stop"72exec { npm ci }73env:74npm_config_arch: $(VSCODE_ARCH)75npm_config_foreground_scripts: "true"76ELECTRON_SKIP_BINARY_DOWNLOAD: 177PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 178GITHUB_TOKEN: "$(github-distro-mixin-password)"79retryCountOnTaskFailure: 580displayName: Install dependencies81condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))8283- powershell: node build/azure-pipelines/distro/mixin-npm.ts84condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))85displayName: Mixin distro node modules8687- powershell: |88. build/azure-pipelines/win32/exec.ps189$ErrorActionPreference = "Stop"90exec { node build/azure-pipelines/common/listNodeModules.ts .build/node_modules_list.txt }91exec { mkdir -Force .build/node_modules_cache }92exec { 7z.exe a .build/node_modules_cache/cache.7z -mx3 `@.build/node_modules_list.txt }93condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))94displayName: Create node_modules archive959697