From 9a5ffa17e3a5ed34cfe3d6cf5f0f487e6b229431 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 24 Jun 2021 08:54:40 -0500 Subject: [PATCH] feat: check npm promotions --- .circleci/config.yml | 2 ++ scripts/verify-npm-promote | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 scripts/verify-npm-promote diff --git a/.circleci/config.yml b/.circleci/config.yml index e8b4c353..288566c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -112,9 +112,11 @@ jobs: - image: node:latest steps: - checkout + - jq/install - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc # if you try to use yarn here, it will attempt to use the wrong registry and throw 401s - run: npm run promote-dist-tags + - run: ./scripts/verify-npm-promote close-CTC: docker: diff --git a/scripts/verify-npm-promote b/scripts/verify-npm-promote new file mode 100755 index 00000000..be87cd05 --- /dev/null +++ b/scripts/verify-npm-promote @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# latest and rc should match after promote before RC build +TAGS=$(npm view sfdx-cli --json | jq -cr '."dist-tags"') +LATEST=$(echo $TAGS | jq -cr '.latest') +echo $LATEST +LATEST_RC=$(echo $TAGS | jq -cr '."latest-rc"') +echo $LATEST_RC +if [ LATEST != LATEST_RC ]; then + echo "latest and latest-rc do not match" + exit 1 +fi