From 4c4fd3a99b0b8c144cc9fe8fb802996ede6168a0 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 11 Nov 2025 01:17:58 +0000 Subject: [PATCH] Fix demo server update workflow race condition Add asset availability check before updating demo server. The workflow now waits up to 5 minutes for checksums.txt and the linux-amd64 tarball to be available before attempting the update. This prevents the install script from failing when the release is published before all assets finish uploading. Resolves demo server downtime during releases. --- .github/workflows/update-demo-server.yml | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/update-demo-server.yml b/.github/workflows/update-demo-server.yml index d6bfe1c..142d52c 100644 --- a/.github/workflows/update-demo-server.yml +++ b/.github/workflows/update-demo-server.yml @@ -17,6 +17,40 @@ jobs: echo "Prerelease: ${{ github.event.release.prerelease }}" echo "Updating demo server to latest stable release..." + - name: Wait for release assets + run: | + TAG="${{ github.event.release.tag_name }}" + echo "Waiting for release assets to be available..." + + MAX_ATTEMPTS=30 + ATTEMPT=0 + + while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do + echo "Checking for assets (attempt $((ATTEMPT + 1))/$MAX_ATTEMPTS)..." + + # Check if checksums.txt and linux-amd64 tarball exist + CHECKSUMS_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ + "https://github.com/rcourtman/Pulse/releases/download/${TAG}/checksums.txt") + TARBALL_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ + "https://github.com/rcourtman/Pulse/releases/download/${TAG}/pulse-${TAG}-linux-amd64.tar.gz") + + echo "checksums.txt: $CHECKSUMS_STATUS, tarball: $TARBALL_STATUS" + + if [ "$CHECKSUMS_STATUS" = "200" ] && [ "$TARBALL_STATUS" = "200" ]; then + echo "✅ Release assets are available!" + exit 0 + fi + + ATTEMPT=$((ATTEMPT + 1)) + if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then + echo "Assets not ready yet, waiting 10 seconds..." + sleep 10 + fi + done + + echo "❌ Timeout waiting for release assets" + exit 1 + - name: Setup SSH run: | mkdir -p ~/.ssh