From 06b2ad63e368f72d2c3efe83ba9dcd11d220f5ef Mon Sep 17 00:00:00 2001 From: avifenesh Date: Mon, 27 May 2024 11:00:58 +0000 Subject: [PATCH] Remove issues with many package.json variation in deployed package --- .github/workflows/node-create-package-file/action.yml | 8 ++++++-- .github/workflows/npm-cd.yml | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-create-package-file/action.yml b/.github/workflows/node-create-package-file/action.yml index f6d4afc9a7..1eace3ba98 100644 --- a/.github/workflows/node-create-package-file/action.yml +++ b/.github/workflows/node-create-package-file/action.yml @@ -69,11 +69,15 @@ runs: # set the registry scope export registry_scope=`if [ "${{ inputs.npm_scope }}" != '' ]; then echo "${{ inputs.npm_scope }}:"; fi` # remove the current name section - SED_FOR_MACOS=`if [[ "${{ inputs.os }}" =~ .*"macos".* ]]; then echo "''"; fi` - sed -i $SED_FOR_MACOS '/"name":/d' ./package.json + if [[ "${{ inputs.os }}" =~ .*"macos".* ]]; then + sed '/"name":/d' ./package.json > temp.json && mv temp.json package.json + else + sed -i '/"name":/d' ./package.json + fi # Remove all `///` occurrences to enable the commented out sections sed -i -e 's|///||g' package.json # generate package.json from the template mv package.json package.json.tmpl envsubst < package.json.tmpl > "package.json" cat package.json + echo $(ls *json*) diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index dc1c3fba8d..7891ce2e24 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -214,6 +214,11 @@ jobs: os: ubuntu target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Del package.json.tmpl + run: | + rm ./node/npm/glide/package.json.tmpl + echo $(ls *json*) - name: Check if RC and set a distribution tag for the package shell: bash