From d5dd7d8dad774ab43bcad4b3b55b95e68ba82f86 Mon Sep 17 00:00:00 2001 From: avifenesh Date: Fri, 22 Nov 2024 12:49:08 +0000 Subject: [PATCH] unpublishing a package owned by more than one cant be unpublised, hence the usage is deprecating Signed-off-by: avifenesh --- .github/workflows/npm-cd.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index a79b069995..bb42df357c 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -354,9 +354,6 @@ jobs: shell: bash working-directory: ./utils run: | - # Error on purpose to test the unpublishing - echo "Error on purpose to test the unpublishing" - exit 1 npm install npm install -g typescript npx tsc -p ./tsconfig.json @@ -382,7 +379,7 @@ jobs: npm install --no-save @valkey/valkey-glide@${{ env.NPM_TAG }} npm run test - - name: Unpublish packages on failure + - name: Deprecating packages on failure if: ${{ always() }} && ${{ failure() }} shell: bash run: | @@ -401,18 +398,18 @@ jobs: RELEASE_VERSION="${GITHUB_REF#refs/tags/v}" fi - echo "Release version for unpublishing: ${RELEASE_VERSION}" + echo "Release version for Deprecating: ${RELEASE_VERSION}" - # Unpublish base package - npm unpublish "@valkey/valkey-glide@${RELEASE_VERSION}" --force || true + # Deprecating base package + npm deprecate "@valkey/valkey-glide@${RELEASE_VERSION}" --force || true # Process platform matrix echo '${{ needs.load-platform-matrix.outputs.PLATFORM_MATRIX }}' > platform_matrix.json while read -r pkg; do package_name="@valkey/valkey-glide-${pkg}" - echo "Unpublishing ${package_name}@${RELEASE_VERSION}" - npm unpublish "${package_name}@${RELEASE_VERSION}" --force || true + echo "Deprecating ${package_name}@${RELEASE_VERSION}" + npm deprecate "${package_name}@${RELEASE_VERSION}" --force || true done < <(jq -r '.[] | "\(.NAMED_OS)\(.TARGET | test("musl") | if . then "-musl" else "" end)-\(.ARCH)"' platform_matrix.json) env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}