File: circle-publish-npm

package info (click to toggle)
node-blueprintjs 4.17.8~git20230417213433.6dab069%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 85,560 kB
  • sloc: javascript: 14,111; sh: 433; makefile: 25
file content (29 lines) | stat: -rwxr-xr-x 661 bytes parent folder | download
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