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
2 changes: 2 additions & 0 deletions pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ steps:
addToPath: true
displayName: 'Use latest Python 3.x'

- template: npm-feed-auth.yml@self

- bash: |
if [ "$(uname)" = "Linux" ]; then
sudo apt-get update -qq
Expand Down
26 changes: 26 additions & 0 deletions pipelines/npm-feed-auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
steps:
- pwsh: |
$feedRegistry = 'https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/'
$npmrcPath = Join-Path '$(Agent.TempDirectory)' 'vscode-feed.npmrc'
Set-Content -Path $npmrcPath -Encoding utf8 -Value @(
"registry=$feedRegistry"
'always-auth=true'
)

Write-Host "##vso[task.setvariable variable=NPM_CONFIG_USERCONFIG]$npmrcPath"

Get-ChildItem -Path '$(Build.SourcesDirectory)' -Filter 'package-lock.json' -Recurse -File | ForEach-Object {
$lockfilePath = $_.FullName
$contents = Get-Content -Path $lockfilePath -Raw
$updatedContents = $contents.Replace('https://registry.npmjs.org/', $feedRegistry).Replace('https://registry.npmjs.com/', $feedRegistry)

if ($updatedContents -ne $contents) {
Set-Content -Path $lockfilePath -Encoding utf8 -Value $updatedContents -NoNewline
}
}
displayName: 'Configure npm to use Monaco vscode feed'

- task: npmAuthenticate@0
displayName: 'Authenticate to Monaco vscode npm feed'
inputs:
workingFile: '$(NPM_CONFIG_USERCONFIG)'
2 changes: 2 additions & 0 deletions publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ extends:
branchName: '$(Build.SourceBranch)'
artifactName: 'prebuilds-$(Build.SourceVersion)'
targetPath: 'prebuilds'
- template: pipelines/npm-feed-auth.yml@self
- pwsh: |
Get-ChildItem -Path . -Recurse -Directory -Name "_manifest" | Remove-Item -Recurse -Force
displayName: 'Delete _manifest folders'
Expand All @@ -72,6 +73,7 @@ extends:
branchName: '$(Build.SourceBranch)'
artifactName: 'prebuilds-$(Build.SourceVersion)'
targetPath: 'prebuilds'
- template: pipelines/npm-feed-auth.yml@self
- bash: chmod +x prebuilds/darwin-*/spawn-helper
displayName: 'Ensure spawn-helper is executable'
- script: npm ci
Expand Down
Loading