Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions build/azure-pipelines/copilot/setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ steps:
condition: and(succeeded(), not(contains(variables['Agent.OS'], 'windows')))
displayName: Setup distro auth (non-Windows)

- pwsh: node build/setup-npm-registry.ts $env:NPM_REGISTRY
workingDirectory: $(Build.SourcesDirectory)
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'), contains(variables['Agent.OS'], 'windows'))
displayName: Setup NPM Registry (Windows)

- script: node build/setup-npm-registry.ts $NPM_REGISTRY
workingDirectory: $(Build.SourcesDirectory)
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'), not(contains(variables['Agent.OS'], 'windows')))
displayName: Setup NPM Registry (non-Windows)

- task: Cache@2
inputs:
key: '"copilot_build_cache" | $(Build.SourcesDirectory)/extensions/copilot/build/.cachesalt | $(Build.SourcesDirectory)/extensions/copilot/build/setup-emsdk.sh | $(Build.SourcesDirectory)/extensions/copilot/package-lock.json'
Expand All @@ -47,6 +57,33 @@ steps:
condition: and(succeeded(), eq(variables.BUILD_CACHE_RESTORED, 'true'))
displayName: Extract copilot build cache

- pwsh: |
$ErrorActionPreference = 'Stop'
# 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 "$env:NPM_REGISTRY"
$NpmrcPath = (npm config get userconfig)
Write-Host "##vso[task.setvariable variable=NPMRC_PATH]$NpmrcPath"
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'), contains(variables['Agent.OS'], 'windows'))
displayName: Setup NPM (Windows)

- 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.BUILD_CACHE_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'), not(contains(variables['Agent.OS'], 'windows')))
displayName: Setup NPM (non-Windows)

- task: npmAuthenticate@0
inputs:
workingFile: $(NPMRC_PATH)
condition: and(succeeded(), ne(variables.BUILD_CACHE_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
displayName: Setup NPM Authentication
Comment thread
rzhao271 marked this conversation as resolved.

- script: npm ci
workingDirectory: build
displayName: Install build dependencies
Expand Down
2 changes: 1 addition & 1 deletion extensions/copilot/build/.cachesalt
Comment thread
rzhao271 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023-12-30T08:16:00.983Z
2026-06-04T18:39:12.866Z
Loading