1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/bin/bash
set -e
set -o pipefail
if [ -z ${CIRCLECI+x} ]; then
echo "Not on Circle; refusing to run."
exit 1
fi
SCRIPTS_DIR="$( dirname "$(readlink -f "$0")" )"
branch="$CIRCLE_BRANCH"
if [ ! -z "$CIRCLE_TAG" ]; then
branch='develop'
fi
if ! [[ "$branch" == "develop" || "$branch" == "next" || "$branch" == release/* ]]; then
echo "Not on develop, next, release/* or a tag - not publishing."
exit 1
fi
if [[ "$branch" == "next" ]]; then
echo "Publishing with next tag because branch name is next"
# must set public access for scoped packages
npm publish --tag next --access public
else
npm publish --access public
fi
|