Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/auto-update-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ jobs:
- name: Setup Repo
uses: ./tools/github/setup-repo

# The SDK dispatches right after publishing, before npm serves the new versions.
- name: Wait for published versions on npm
shell: bash
env:
PACKAGES: ${{ toJson(github.event.client_payload.packages) }}
run: |
for row in $(echo "$PACKAGES" | jq -c '.[]'); do
PKG=$(echo "$row" | jq -r '.name')
VER=$(echo "$row" | jq -r '.version')

for attempt in $(seq 1 10); do
if [ "$(npm view "$PKG@$VER" version 2>/dev/null)" = "$VER" ]; then
echo "✅ $PKG@$VER is available"
continue 2
fi
echo "⏳ $PKG@$VER not on npm yet (attempt $attempt/10)"
sleep 30
done

echo "::error::$PKG@$VER was not available on npm after 5 minutes"
exit 1
done

- name: Update @swapkit/* dependencies
shell: bash
run: |
Expand Down
Loading