File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,24 +67,10 @@ jobs:
6767
6868 - name : Publish to npm
6969 run : |
70- npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
71- publish() { # use latest npm to ensure OIDC support
72- npx -y npm@latest publish "$@"
73- }
74- if [[ ${GITHUB_REF} == *alpha* ]]; then
75- publish --access public --tag alpha
76- elif [[ ${GITHUB_REF} == *beta* ]]; then
77- publish --access public --tag beta
78- else
79- PKG_NAME=$(node -p "require('./package.json').name")
80- PKG_VERSION=$(node -p "require('./package.json').version")
81- CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0")
82- if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then
83- echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})"
84- publish --access public --tag backport
85- else
86- publish --access public
87- fi
88- fi
89- env :
90- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
70+ if [[ ${GITHUB_REF} == *alpha* ]]; then
71+ npm publish --access public --tag alpha
72+ elif [[ ${GITHUB_REF} == *beta* ]]; then
73+ npm publish --access public --tag beta
74+ else
75+ npm publish --access public
76+ fi
You can’t perform that action at this time.
0 commit comments