From 9e59fc9a83dccf07ef6f4ef04d061661fab07c61 Mon Sep 17 00:00:00 2001 From: Christoph Reiter <reiter.christoph@gmail.com> Date: Tue, 1 Dec 2020 15:28:24 +0100 Subject: [PATCH] Write npmrc file in CI only locally yarn would fail because it can't expand the env var because it is usually missing: error An unexpected error occurred: "Failed to replace env in config: ${NPM_TOKEN}" --- .gitlab-ci.yml | 1 + .npmrc | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .npmrc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 892ef337..6d685f1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,7 @@ publish: - publish - master script: + - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc - sudo npm install --global can-npm-publish - yarn config set registry https://registry.npmjs.org/ - yarn config set cache-folder "$CI_PROJECT_DIR/_yarn_cache" diff --git a/.npmrc b/.npmrc deleted file mode 100644 index bd3327ab..00000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -//registry.npmjs.org/:_authToken=${NPM_TOKEN} \ No newline at end of file -- GitLab