diff --git a/.github/workflows/release-shell-pkg.yaml b/.github/workflows/release-shell-pkg.yaml index bb9ab033db7..9c3566e1173 100644 --- a/.github/workflows/release-shell-pkg.yaml +++ b/.github/workflows/release-shell-pkg.yaml @@ -45,6 +45,6 @@ jobs: run: yarn install --frozen-lockfile - name: Publish Shell Package to npm - run: yarn publish-shell-reset-reg + run: ./shell/scripts/publish-shell.sh --npm env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/shell/scripts/publish-shell.sh b/shell/scripts/publish-shell.sh index 3f1f76729b7..4c5980a1c01 100755 --- a/shell/scripts/publish-shell.sh +++ b/shell/scripts/publish-shell.sh @@ -8,6 +8,8 @@ BASE_DIR="$( SHELL_DIR=$BASE_DIR/shell/ TMP_DIR=$BASE_DIR/tmp PUBLISH_ARGS="--no-git-tag-version --access public $PUBLISH_ARGS" +FORCE_PUBLISH_TO_NPM="false" +DEFAULT_YARN_REGISTRY="https://registry.npmjs.org" if [ ! -d "${BASE_DIR}/node_modules" ]; then echo "You need to run 'yarn install' first" @@ -16,6 +18,14 @@ fi echo "Publishing Shell Packages" +if [ "$1" == "--npm" ]; then + FORCE_PUBLISH_TO_NPM="true" +fi + +if [ "$FORCE_PUBLISH_TO_NPM" == "true" ]; then + export YARN_REGISTRY=$DEFAULT_YARN_REGISTRY +fi + # We use the version from the shell package for the creator packages # Need to copy them to a temporary location, so we can patch the version number # before publishing