Skip to content

Commit

Permalink
Merge eff7e70 into ea53674
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkuttappan authored Mar 25, 2021
2 parents ea53674 + eff7e70 commit c9e2e13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eng/pipelines/templates/stages/archetype-js-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ stages:
inputs:
targetType: filePath
filePath: "eng/tools/publish-to-npm.ps1"
arguments: '-pathToArtifacts $(Package.Archive) -accessLevel "public" -tag $(Tag) -additionalTag "$(AdditionalTag)" -registry ${{parameters.Registry}} -npmToken $(azure-sdk-npm-token)'
arguments: '-pathToArtifacts $(Package.Archive) -accessLevel "public" -tag "$(Tag)" -additionalTag "$(AdditionalTag)" -registry ${{parameters.Registry}} -npmToken $(azure-sdk-npm-token)'
pwsh: true

- ${{if ne(artifact.skipPublishDocMs, 'true')}}:
Expand Down
15 changes: 12 additions & 3 deletions eng/tools/publish-to-npm.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param (
$pathToArtifacts,
$accessLevel,
$tag,
$tag="",
$additionalTag="",
$registry,
$npmToken,
Expand Down Expand Up @@ -124,8 +124,17 @@ try {

foreach ($p in $packageList) {
if($p.Publish) {
Write-Host "npm publish $($p.TarGz) --access=$accessLevel --registry=$registry --always-auth=true --tag=$tag"
npm publish $p.TarGz --access=$accessLevel --registry=$registry --always-auth=true --tag=$tag
if ($tag)
{
Write-Host "npm publish $($p.TarGz) --access=$accessLevel --registry=$registry --always-auth=true --tag=$tag"
npm publish $p.TarGz --access=$accessLevel --registry=$registry --always-auth=true --tag=$tag
}
else
{
Write-Host "npm publish $($p.TarGz) --access=$accessLevel --registry=$registry --always-auth=true"
npm publish $p.TarGz --access=$accessLevel --registry=$registry --always-auth=true
}

if ($LastExitCode -ne 0) {
Write-Host "npm publish failed with exit code $LastExitCode"
exit 1
Expand Down

0 comments on commit c9e2e13

Please sign in to comment.