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
13 changes: 7 additions & 6 deletions eng/common/pipelines/templates/jobs/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ jobs:
Write-Host "##vso[task.setvariable variable=TagName]$tag"
Write-Host "Publishing packages with tag: $tag"
displayName: 'Packages to be published'

- template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml
parameters:
npmrcPath: $(ArtifactPath)/.npmrc
registryUrl: ${{ parameters.Registry }}
CustomCondition: and(succeeded(), ne(variables['SkipPublishing'], 'true'))

- ${{ if eq(parameters.Registry, 'https://registry.npmjs.org/') }}:

Expand Down Expand Up @@ -119,6 +113,13 @@ jobs:
condition: and(succeeded(), ne(variables['SkipPublishing'], 'true'))

- ${{ else }}:

- template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml
parameters:
npmrcPath: $(ArtifactPath)/.npmrc
registryUrl: ${{ parameters.Registry }}
CustomCondition: and(succeeded(), ne(variables['SkipPublishing'], 'true'))

- pwsh: |
foreach ($package in (dir $(ArtifactPath) *.tgz -Recurse)) {
Write-Host "npm publish $package --verbose --access public --tag $(TagName) --registry ${{ parameters.Registry }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
WorkingDirectory: ''
ScriptDirectory: eng/common/scripts
NpmConfigUserConfig: ''
NpmConfigRegistry: ''

steps:
- task: PowerShell@2
Expand All @@ -26,3 +27,5 @@ steps:
GH_TOKEN: $(azuresdk-github-pat)
${{ if ne(parameters.NpmConfigUserConfig, '') }}:
NPM_CONFIG_USERCONFIG: ${{ parameters.NpmConfigUserConfig }}
${{ if ne(parameters.NpmConfigRegistry, '') }}:
NPM_CONFIG_REGISTRY: ${{ parameters.NpmConfigRegistry }}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ parameters:
- name: NpmConfigUserConfig
type: string
default: ''
- name: NpmConfigRegistry
type: string
default: ''
steps:
- ${{ if eq(length(parameters.PackageInfoLocations), 0) }}:
- pwsh: |
Expand Down Expand Up @@ -97,6 +100,8 @@ steps:
env:
${{ if ne(parameters.NpmConfigUserConfig, '') }}:
NPM_CONFIG_USERCONFIG: ${{ parameters.NpmConfigUserConfig }}
${{ if ne(parameters.NpmConfigRegistry, '') }}:
NPM_CONFIG_REGISTRY: ${{ parameters.NpmConfigRegistry }}

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
Expand Down
Loading