ci: extract + fix await-published logic
This commit is contained in:
parent
fea7eebb15
commit
723fe1e4ac
|
@ -19,23 +19,9 @@ jobs:
|
||||||
- name: Set TAG
|
- name: Set TAG
|
||||||
run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
||||||
- name: Wait for published
|
- name: Wait for published
|
||||||
run: |
|
env:
|
||||||
i=0
|
PKG: 'bpmn-js@${{ env.TAG }}'
|
||||||
pkg="bpmn-js@${{ env.TAG }}"
|
run: tasks/stages/await-published
|
||||||
|
|
||||||
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
|
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue