From afcdc58419c0771a2ab822fe368aa591229cbeee Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 19 Jan 2023 17:21:17 -0300 Subject: [PATCH] Delete tag next once latest is published (#3973) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ernesto GarcĂ­a --- scripts/release/workflow/publish.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/release/workflow/publish.sh b/scripts/release/workflow/publish.sh index 89a0aed3c..f9e2802d9 100644 --- a/scripts/release/workflow/publish.sh +++ b/scripts/release/workflow/publish.sh @@ -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