From 5d19b125bf03f9a91b704dd4ba60118ead56a005 Mon Sep 17 00:00:00 2001 From: alvarius Date: Wed, 27 Sep 2023 12:40:42 +0100 Subject: [PATCH] chore: add dist-tag-rm script to remove tags from npm (#1623) --- .github/workflows/remove-npm-tag.yml | 24 ++++++++++++++++++++++++ package.json | 1 + 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/remove-npm-tag.yml diff --git a/.github/workflows/remove-npm-tag.yml b/.github/workflows/remove-npm-tag.yml new file mode 100644 index 0000000000..bbf4ed5ab4 --- /dev/null +++ b/.github/workflows/remove-npm-tag.yml @@ -0,0 +1,24 @@ +name: Remove npm tag + +on: + workflow_dispatch: + +jobs: + remove-npm-tag: + name: Remove an npm dist tag for the current branch + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + + - name: Set deployment token + run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Remove npm dist tag + run: pnpm dist-tag-rm + env: TAG=${{ github.ref_name }} diff --git a/package.json b/package.json index aaa8b1db88..625bf7cd49 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build": "turbo run build", "clean": "turbo run clean", "dev": "turbo run dev --concurrency 100", + "dist-tag-rm": "pnpm recursive exec -- sh -c 'npm dist-tag rm $(cat package.json | jq -r \".name\") $TAG || true'", "foundryup": "curl -L https://foundry.paradigm.xyz | bash && bash ~/.foundry/bin/foundryup", "gas-report": "pnpm recursive run gas-report", "lint": "pnpm prettier:check && eslint . --ext .ts --ext .tsx",