From 118533c101fd153c077a8e7f17b5f4f1ae0acb19 Mon Sep 17 00:00:00 2001 From: CoCo_Code_Op1123 Date: Fri, 18 Jun 2021 16:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0.codechina-ci.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .codechina-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.codechina-ci.yml b/.codechina-ci.yml index 0106d0f..86e616e 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 -- GitLab