diff --git a/.codechina-ci.yml b/.codechina-ci.yml index 0106d0f0989c93f3213d2824b6be86bcf9006cf4..86e616e5968eca333de432ada722ea2ff84c6a8f 100644 --- a/.codechina-ci.yml +++ b/.codechina-ci.yml @@ -22,16 +22,16 @@ publish: stage: deploy script: # If no .npmrc if included in the repo, generate a temporary one + - echo $NPM_PUBLISH_TOKEN + - echo "https//registry.npmjs.org/:_authToken=\${NPM_PUBLISH_TOKEN}" - | if [[ ! -f .npmrc ]]; then echo 'No .npmrc found! Creating one now. Now we will generate one' { - echo "//registry.npmjs.org/:_authToken=\${NPM_PUBLISH_TOKEN}" + echo "https//registry.npmjs.org/:_authToken=\${NPM_PUBLISH_TOKEN}" } >> .npmrc fi - - npm config get registry - - echo "Created the following .npmrc:" - - cat .npmrc + - echo "Created the following .npmrc:"; cat .npmrc # Extract a few values from package.json - NPM_PACKAGE_NAME=$(node -p "require('./package.json').name") @@ -39,6 +39,7 @@ publish: # Compare the version in package.json to all published versions. # If the package.json version has not yet been published, run `npm publish`. + - npm config get registry - | if [[ $(npm view "${NPM_PACKAGE_NAME}" versions) != *"'${NPM_PACKAGE_VERSION}'"* ]]; then npm publish