From 031b53f03c83be8006ad8a6786f89f286649ad47 Mon Sep 17 00:00:00 2001 From: Maciej Lenartowicz Date: Fri, 1 Nov 2019 10:49:45 +0100 Subject: [PATCH] Fixed publish script --- scripts/publish.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/publish.sh b/scripts/publish.sh index ce3dc5e..172b7a7 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -5,6 +5,7 @@ then echo "\$NPM_TOKEN is not set" exit 1 else + cd dist # Need to replace "_" with "-" as GitLab CI won't accept secret vars with "-" echo "//registry.npmjs.org/:_authToken=$(echo "$NPM_TOKEN" | tr _ -)" > .npmrc echo "unsafe-perm = true" >> ~/.npmrc @@ -12,10 +13,10 @@ else then BETA_VERSION=$(npx -c 'echo "$npm_package_version"')-beta.$CI_COMMIT_SHORT_SHA npm version "$BETA_VERSION" --git-tag-version false - cd dist && npm publish --tag beta + npm publish --tag beta elif test "$1" = "latest" then - cd dist && npm publish + npm publish else echo "Usage: publish.sh [ beta | latest ]" exit 1