You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
411 B
16 lines
411 B
2 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -euo pipefail
|
||
|
|
||
|
# Intentionally escape $ to avoid interpolation and writing the token to disk
|
||
|
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
|
||
|
|
||
|
# Actual publish
|
||
|
npm publish "$TARBALL" --tag "$TAG"
|
||
|
|
||
|
if [ "$TAG" = "tmp" ]; then
|
||
|
# Remove tmp tag
|
||
|
PACKAGE_JSON_NAME="$(tar xfO "$TARBALL" package/package.json | jq -r .name)"
|
||
|
npm dist-tag rm "$PACKAGE_JSON_NAME" "$TAG"
|
||
|
fi
|