Skip to content

Commit

Permalink
fix: fix dist tags issue (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoyi Chen committed Aug 10, 2021
1 parent 59c6fea commit 1b85972
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,19 @@ commands:
- npm-release-management/publish:
use_tarfile: true
- run:
name: Wait for dist-tags to become available
name: Wait for version to become available on NPM
command: |
PKG_NAME=$(cat package.json | jq -r .name)
PKG_VERSION=$(cat package.json | jq -r .version)
MAX_TRIES=300
MAX_TRIES=30
TRIES=0
until (( $(curl -s 'https://registry.npmjs.org/'$PKG_NAME | jq '.["dist-tags"]["latest"]' | grep -c $PKG_VERSION ) )) || (($TRIES >= $MAX_TRIES )); do
until (($(npm view $PKG_NAME versions --json | jq "map(select(. == \"$PKG_VERSION\")) | length") > 0)) || (($TRIES >= $MAX_TRIES )); do
printf '.'
sleep 1
TRIES=$((TRIES+1))
done
if (($TRIES >= $MAX_TRIES)); then
echo "Timeout waiting for dist-tags. Exiting job"
echo "Timeout waiting for tag. Exiting job"
exit 1
fi
- npm-release-management/verify-signed-package
Expand Down

0 comments on commit 1b85972

Please sign in to comment.