Skip to content

Commit

Permalink
Revert "Make tag as optional (Azure#14427)" (Azure#14766)
Browse files Browse the repository at this point in the history
- Azure#14427 appears to cause all packages to be published with no tags.
- This reverts commit 74a6162.
  • Loading branch information
mikeharder authored Apr 7, 2021
1 parent c269edf commit b2e23e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 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 $env:Tag -additionalTag $env: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: 3 additions & 12 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 @@ -125,17 +125,8 @@ try {

foreach ($p in $packageList) {
if($p.Publish) {
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
}

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 ($LastExitCode -ne 0) {
Write-Host "npm publish failed with exit code $LastExitCode"
exit 1
Expand Down

0 comments on commit b2e23e3

Please sign in to comment.