File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6969 sed -i '/_authToken/d' "$NPM_CONFIG_USERCONFIG"
7070 unset NODE_AUTH_TOKEN
7171
72+ PKG=$(node -p "require('./package.json').name")
7273 BASE_VERSION=$(node -p "require('./package.json').version")
74+ # If package.json's version is already a PUBLISHED stable, this canary is work toward the
75+ # NEXT version — bump the patch so the canary sorts ABOVE the release (else BASE-canary.X
76+ # ranks below the published BASE). Unreleased versions (the 0.1.0 hold) are left as-is.
77+ if [ -n "$(npm view "${PKG}@${BASE_VERSION}" version 2>/dev/null || true)" ]; then
78+ BASE_VERSION=$(node -e "const v=require('./package.json').version.split('.').map(Number); console.log(v[0]+'.'+v[1]+'.'+(v[2]+1))")
79+ fi
7380 SHORT_SHA=$(echo "$GITHUB_SHA" | cut -c1-7)
7481 CANARY_VERSION="${BASE_VERSION}-canary.${SHORT_SHA}"
7582 npm version "$CANARY_VERSION" --no-git-tag-version --ignore-scripts
You can’t perform that action at this time.
0 commit comments