2019-10-07 16:43:57 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if test -z "$NPM_TOKEN"
|
|
|
|
then
|
|
|
|
echo "\$NPM_TOKEN is not set"
|
|
|
|
exit 1
|
|
|
|
else
|
2019-11-01 10:49:45 +01:00
|
|
|
cd dist
|
2022-02-28 16:42:30 +01:00
|
|
|
echo "//registry.npmjs.org/:_authToken=$(echo "$NPM_TOKEN")" > .npmrc
|
2019-10-07 16:43:57 +02:00
|
|
|
echo "unsafe-perm = true" >> ~/.npmrc
|
|
|
|
if test "$1" = "beta"
|
|
|
|
then
|
2019-10-11 10:15:53 +02:00
|
|
|
BETA_VERSION=$(npx -c 'echo "$npm_package_version"')-beta.$CI_COMMIT_SHORT_SHA
|
2019-10-15 10:10:33 +02:00
|
|
|
npm version "$BETA_VERSION" --git-tag-version false
|
2019-11-01 10:49:45 +01:00
|
|
|
npm publish --tag beta
|
2019-10-07 16:43:57 +02:00
|
|
|
elif test "$1" = "latest"
|
|
|
|
then
|
2019-11-01 10:49:45 +01:00
|
|
|
npm publish
|
2019-10-07 16:43:57 +02:00
|
|
|
else
|
|
|
|
echo "Usage: publish.sh [ beta | latest ]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|