Skip to content

Commit

Permalink
unpublishing a package owned by more than one cant be unpublised, hen…
Browse files Browse the repository at this point in the history
…ce the usage is deprecating

Signed-off-by: avifenesh <[email protected]>
  • Loading branch information
avifenesh committed Nov 22, 2024
1 parent 09473f7 commit d5dd7d8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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 }}
Expand Down

0 comments on commit d5dd7d8

Please sign in to comment.