@@ -161,16 +161,33 @@ if [[ $ATTEMPTS -ge $MAX_ATTEMPTS ]]; then
161161 exit 0
162162fi
163163
164- # Step 7: Check all platform assets
164+ # Step 7: Wait for all platform assets
165+ MIN_ASSETS=10
165166echo " "
166- echo " → Checking release assets..."
167- ASSET_COUNT=$( gh release view " $TAG " --repo cortexkit/opencode-magic-context --json assets --jq ' .assets | length' 2> /dev/null || echo " 0" )
168- echo " Found $ASSET_COUNT assets"
169-
170- if [[ " $ASSET_COUNT " -lt 10 ]]; then
171- echo " ⚠ Expected ~17 assets (4 platforms × ~4 files + latest.json)"
172- echo " → Some platforms may still be building. Wait and check manually."
173- read -rp " Publish anyway? [y/N] " confirm
167+ echo " → Waiting for all platform assets (expecting ≥$MIN_ASSETS )..."
168+ echo " (checking every 30s for up to 60 minutes)"
169+ ASSET_ATTEMPTS=0
170+ ASSET_MAX=120
171+ ASSET_COUNT=0
172+ while [[ $ASSET_ATTEMPTS -lt $ASSET_MAX ]]; do
173+ ASSET_COUNT=$( gh release view " $TAG " --repo cortexkit/opencode-magic-context --json assets --jq ' .assets | length' 2> /dev/null || echo " 0" )
174+
175+ if [[ " $ASSET_COUNT " -ge " $MIN_ASSETS " ]]; then
176+ echo " ✓ Found $ASSET_COUNT assets — all platforms built"
177+ break
178+ fi
179+
180+ ASSET_ATTEMPTS=$(( ASSET_ATTEMPTS + 1 ))
181+ if [[ $(( ASSET_ATTEMPTS % 4 )) -eq 0 ]]; then
182+ ELAPSED=$(( ASSET_ATTEMPTS * 30 / 60 ))
183+ echo " ... $ASSET_COUNT assets so far (${ELAPSED} m elapsed)"
184+ fi
185+ sleep 30
186+ done
187+
188+ if [[ " $ASSET_COUNT " -lt " $MIN_ASSETS " ]]; then
189+ echo " ⚠ Only $ASSET_COUNT assets after waiting. Some platforms may have failed."
190+ read -r -p " Publish with $ASSET_COUNT assets? [y/N] " confirm < /dev/tty
174191 if [[ " $confirm " != " y" && " $confirm " != " Y" ]]; then
175192 echo " Skipping publish. Run manually: gh release edit $TAG --draft=false"
176193 exit 0
@@ -183,7 +200,7 @@ echo "→ Enter release notes (end with Ctrl-D or empty line):"
183200echo " (markdown supported)"
184201echo " "
185202NOTES=" "
186- while IFS= read -r line; do
203+ while IFS= read -r line < /dev/tty ; do
187204 [[ -z " $line " ]] && break
188205 NOTES=" $NOTES$line
189206"
0 commit comments