Skip to content

Commit

Permalink
Add Azure NPM registry to CI test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andyleejordan committed Feb 14, 2024
1 parent ab4f204 commit f73c9ad
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ jobs:
cache: npm
cache-dependency-path: vscode-powershell/package-lock.json

- name: Deploy NPM configuration
shell: pwsh
run: Copy-Item .github/workflows/npmrc .npmrc

- name: Start X virtual framebuffer
if: matrix.os == 'ubuntu-latest'
run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

- name: Build, test and package
shell: pwsh
run: Invoke-Build
env:
NPM_AUTH_TOKEN: ${{ secrets.AZURE_NPM_TOKEN }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; This requires NPM_AUTH_TOKEN to be available as a base64 encoded secret, since
; Azure DevOps does not support actual auth tokens.

; begin auth token
//pkgs.dev.azure.com/powershell-rel/PowerShellEditorServices/_packaging/PSESFeed/npm/registry/:username=powershell-rel
//pkgs.dev.azure.com/powershell-rel/PowerShellEditorServices/_packaging/PSESFeed/npm/registry/:_password=${NPM_AUTH_TOKEN}
//pkgs.dev.azure.com/powershell-rel/PowerShellEditorServices/_packaging/PSESFeed/npm/registry/:email=powershell-rel
//pkgs.dev.azure.com/powershell-rel/PowerShellEditorServices/_packaging/PSESFeed/npm/:username=powershell-rel
//pkgs.dev.azure.com/powershell-rel/PowerShellEditorServices/_packaging/PSESFeed/npm/:_password=${NPM_AUTH_TOKEN}
//pkgs.dev.azure.com/powershell-rel/PowerShellEditorServices/_packaging/PSESFeed/npm/:email=powershell-rel
; end auth token
registry=https://pkgs.dev.azure.com/powershell-rel/PowerShellEditorServices/_packaging/PSESFeed/npm/registry/
always-auth=true
2 changes: 1 addition & 1 deletion .vsts-ci/templates/publish-markets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
workingFile: .npmrc

- pwsh: |
npm ci --loglevel=error
npm ci --loglevel=error --ignore-scripts
Import-Module $(Build.SourcesDirectory)/tools/VersionTools.psm1
$Version = Get-Version -RepositoryName vscode-powershell
$PackageVersion = Get-MajorMinorPatch -Version $Version
Expand Down
4 changes: 2 additions & 2 deletions vscode-powershell.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ task RestoreNodeModules -If { !(Test-Path ./node_modules) } {
Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green
# When in a CI build use the --loglevel=error parameter so that
# package install warnings don't cause PowerShell to throw up
if ($env:TF_BUILD) {
Invoke-BuildExec { & npm ci --loglevel=error }
if ($env:CI -or $env:TF_BUILD) {
Invoke-BuildExec { & npm ci --loglevel=error --ignore-scripts }
} else {
Invoke-BuildExec { & npm install }
}
Expand Down

0 comments on commit f73c9ad

Please sign in to comment.