Skip to content

Commit

Permalink
Delete tag next once latest is published (#3973)
Browse files Browse the repository at this point in the history
Co-authored-by: Ernesto García <ernestognw@gmail.com>
  • Loading branch information
frangio and ernestognw authored Jan 19, 2023
1 parent dc1ffa7 commit afcdc58
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/release/workflow/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
# Actual publish
npm publish "$TARBALL" --tag "$TAG"

if [ "$TAG" = "tmp" ]; then
# Remove tmp tag
delete_tag() {
PACKAGE_JSON_NAME="$(tar xfO "$TARBALL" package/package.json | jq -r .name)"
npm dist-tag rm "$PACKAGE_JSON_NAME" "$TAG"
npm dist-tag rm "$PACKAGE_JSON_NAME" "$1"
}

if [ "$TAG" = tmp ]; then
delete_tag "$TAG"
elif ["$TAG" = latest ]; then
delete_tag next
fi

0 comments on commit afcdc58

Please sign in to comment.