From 72c0eff1b1508005f2897c9f3fa66c6e6d688556 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 16 Sep 2021 10:17:02 +0200 Subject: [PATCH] ci: extract + fix await-published logic --- .github/workflows/POST_RELEASE.yml | 20 +++----------------- tasks/stages/await-published | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) create mode 100755 tasks/stages/await-published diff --git a/.github/workflows/POST_RELEASE.yml b/.github/workflows/POST_RELEASE.yml index 28341628..e8a690f8 100644 --- a/.github/workflows/POST_RELEASE.yml +++ b/.github/workflows/POST_RELEASE.yml @@ -19,23 +19,9 @@ jobs: - name: Set TAG run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - name: Wait for published - run: | - i=0 - pkg="bpmn-js@${{ env.TAG }}" - - until [ $i -gt 10 ] - do - echo "Checking for $pkg in npm registry..." - - info=$(npm info $pkg) - if [[ "$info" != "" ]]; then - echo "Found." - break - fi - - ((i++)) - sleep 15s - done + env: + PKG: 'bpmn-js@${{ env.TAG }}' + run: tasks/stages/await-published - name: Use Node.js uses: actions/setup-node@v2 with: diff --git a/tasks/stages/await-published b/tasks/stages/await-published new file mode 100755 index 00000000..52dfcb35 --- /dev/null +++ b/tasks/stages/await-published @@ -0,0 +1,19 @@ +#!/bin/bash + +set -eo pipefail +shopt -s inherit_errexit nullglob + +i=0 +pkg="$PKG" +until [ $i -gt 10 ] +do + echo "Checking for $pkg in npm registry ($((i+1))/10)" + info=$(npm info $pkg) + if [[ "$info" != "" ]]; then + echo "Found." + break + fi + + i=$((var+1)) + sleep 15s +done \ No newline at end of file