Skip to content

Commit

Permalink
Merge e2567db into c52b93c
Browse files Browse the repository at this point in the history
  • Loading branch information
ckairen authored May 1, 2024
2 parents c52b93c + e2567db commit f60f512
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 12 additions & 10 deletions eng/pipelines/templates/steps/npm-release-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:

steps:
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
- ${{if eq(parameters.Registry, 'https://registry.npmjs.org/')}}:
- ${{ if eq(parameters.Registry, 'https://registry.npmjs.org/') }}:
- task: EsrpRelease@6
inputs:
displayName: 'Publish ${{parameters.Artifact.name}} to ESRP'
Expand All @@ -22,16 +22,18 @@ steps:
MainPublisher: 'ESRPRELPACMANTEST'
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
ProductStateField: ${{parameters.Tag}}
- pwsh: Write-Host "##vso[task.setvariable variable=additionalTag${{parameters.AdditionalTag}}]"
displayName: Set Additional Tag Variable

- ${{if ne(parameters.AdditionalTag, '')}}:
- task: PowerShell@2
displayName: Add Additional Tag
inputs:
targetType: filePath
filePath: eng/tools/publish-to-npm.ps1
arguments: -addTag $true -pathToArtifacts ${{parameters.PathToArtifacts}} -accessLevel "public" -tag "${{parameters.AdditionalTag}}" -registry ${{parameters.Registry}} -npmToken $(azure-sdk-npm-token)
pwsh: true
condition: succeeded()
- ${{ if ne(variables['additionalTag'], '') }}:
- task: PowerShell@2
displayName: Add Additional Tag
inputs:
targetType: filePath
filePath: eng/tools/publish-to-npm.ps1
arguments: -addTag $true -pathToArtifacts ${{parameters.PathToArtifacts}} -accessLevel "public" -tag "${{parameters.AdditionalTag}}" -registry ${{parameters.Registry}} -npmToken $(azure-sdk-npm-token)
pwsh: true
condition: succeeded()

- ${{ else }}:
- task: PowerShell@2
Expand Down
4 changes: 3 additions & 1 deletion eng/tools/publish-to-npm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ try {
Write-Host "npm dist-tag add $nameAndVersion $tag"
npm dist-tag add $nameAndVersion $tag
}
if ($additionalTag -ne "" && $additionalTag -ne $tag) {
if (![string]::IsNullOrWhitespace($additionalTag) -and ($additionalTag -ne $tag)) {
Write-Host "Tag: '$tag'"
Write-Host "Additional tag: '$additionalTag'"
Write-Host "Adding additional tag for package"
Write-Host "npm dist-tag add $nameAndVersion $additionalTag"
npm dist-tag add $nameAndVersion $additionalTag
Expand Down

0 comments on commit f60f512

Please sign in to comment.