55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
|
parameters:
|
||
|
- name: VSCODE_BUILD_MACOS
|
||
|
type: boolean
|
||
|
- name: VSCODE_BUILD_MACOS_ARM64
|
||
|
type: boolean
|
||
|
|
||
|
steps:
|
||
|
- task: NodeTool@0
|
||
|
inputs:
|
||
|
versionSource: fromFile
|
||
|
versionFilePath: .nvmrc
|
||
|
nodejsMirror: https://github.com/joaomoreno/node-mirror/releases/download
|
||
|
|
||
|
- script: node build/setup-npm-registry.js $NPM_REGISTRY build
|
||
|
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
|
||
|
displayName: Setup NPM Registry
|
||
|
|
||
|
- script: |
|
||
|
set -e
|
||
|
# Set the private NPM registry to the global npmrc file
|
||
|
# so that authentication works for subfolders like build/, remote/, extensions/ etc
|
||
|
# which does not have their own .npmrc file
|
||
|
npm config set registry "$NPM_REGISTRY"
|
||
|
echo "##vso[task.setvariable variable=NPMRC_PATH]$(npm config get userconfig)"
|
||
|
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
|
||
|
displayName: Setup NPM
|
||
|
|
||
|
- task: npmAuthenticate@0
|
||
|
inputs:
|
||
|
workingFile: $(NPMRC_PATH)
|
||
|
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
|
||
|
displayName: Setup NPM Authentication
|
||
|
|
||
|
- script: |
|
||
|
set -e
|
||
|
|
||
|
for i in {1..5}; do # try 5 times
|
||
|
npm ci && break
|
||
|
if [ $i -eq 5 ]; then
|
||
|
echo "Npm install failed too many times" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
echo "Npm install failed $i, trying again..."
|
||
|
done
|
||
|
workingDirectory: build
|
||
|
displayName: Install build dependencies
|
||
|
|
||
|
- template: ../cli/cli-darwin-sign.yml@self
|
||
|
parameters:
|
||
|
VSCODE_CLI_ARTIFACTS:
|
||
|
- ${{ if eq(parameters.VSCODE_BUILD_MACOS, true) }}:
|
||
|
- unsigned_vscode_cli_darwin_x64_cli
|
||
|
- ${{ if eq(parameters.VSCODE_BUILD_MACOS_ARM64, true) }}:
|
||
|
- unsigned_vscode_cli_darwin_arm64_cli
|