diff --git a/ci/steps/publish-npm.sh b/ci/steps/publish-npm.sh index 7bd497d0..ea65780d 100755 --- a/ci/steps/publish-npm.sh +++ b/ci/steps/publish-npm.sh @@ -5,6 +5,14 @@ main() { cd "$(dirname "$0")/../.." source ./ci/lib.sh + # npm view won't exit with non-zero so we have to check the output. + local hasVersion + hasVersion=$(npm view "code-server@$VERSION" version) + if [[ $hasVersion == "$VERSION" ]]; then + echo "$VERSION is already published" + return + fi + if [[ ${CI-} ]]; then echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc fi