diff --git a/eng/common/pipelines/templates/jobs/npm-publish.yml b/eng/common/pipelines/templates/jobs/npm-publish.yml index f3b91bcd0119..1f454d13548e 100644 --- a/eng/common/pipelines/templates/jobs/npm-publish.yml +++ b/eng/common/pipelines/templates/jobs/npm-publish.yml @@ -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/') }}: @@ -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 }}" diff --git a/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml b/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml index 28a5bf7fac61..dc15bbdc44d7 100644 --- a/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml +++ b/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml @@ -7,6 +7,7 @@ parameters: WorkingDirectory: '' ScriptDirectory: eng/common/scripts NpmConfigUserConfig: '' + NpmConfigRegistry: '' steps: - task: PowerShell@2 @@ -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 }} diff --git a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml index 9b4f9e33b67c..bf69c880e893 100644 --- a/eng/common/pipelines/templates/steps/update-docsms-metadata.yml +++ b/eng/common/pipelines/templates/steps/update-docsms-metadata.yml @@ -32,6 +32,9 @@ parameters: - name: NpmConfigUserConfig type: string default: '' + - name: NpmConfigRegistry + type: string + default: '' steps: - ${{ if eq(length(parameters.PackageInfoLocations), 0) }}: - pwsh: | @@ -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: