Delete tag next once latest is published (#3973)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
This commit is contained in:
Francisco
2023-01-19 17:21:17 -03:00
committed by GitHub
parent dc1ffa79e7
commit afcdc58419

View File

@ -8,8 +8,13 @@ echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
# Actual publish # Actual publish
npm publish "$TARBALL" --tag "$TAG" npm publish "$TARBALL" --tag "$TAG"
if [ "$TAG" = "tmp" ]; then delete_tag() {
# Remove tmp tag
PACKAGE_JSON_NAME="$(tar xfO "$TARBALL" package/package.json | jq -r .name)" 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 fi