File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,11 +224,33 @@ jobs:
224224 if [[ $ANY -eq 0 ]]; then
225225 echo "Nothing to upload."
226226 else
227- # Upload files one by one (prevents 400 errors)
227+ # Upload files one by one. Never abort the whole loop on a single
228+ # failed upload: GitHub's 2 GiB-per-asset limit means the largest
229+ # meshes legitimately can't be released, and we still want the
230+ # rest to land.
231+ set +e
232+ MAX_SIZE=$((2 * 1024 * 1024 * 1024)) # 2 GiB
233+ FAILED=0
234+ SKIPPED_LARGE=0
235+ UPLOADED=0
228236 for f in release_assets/*; do
237+ SZ=$(stat -c%s "$f" 2>/dev/null || stat -f%z "$f")
238+ if [[ -n "$SZ" && $SZ -ge $MAX_SIZE ]]; then
239+ echo "::warning ::$(basename "$f") is ${SZ} bytes, above GitHub's 2 GiB limit — skipping."
240+ SKIPPED_LARGE=$((SKIPPED_LARGE + 1))
241+ continue
242+ fi
229243 echo "Uploading : $f"
230244 gh release upload "$TAG" "$f" --clobber
245+ if [[ $? -ne 0 ]]; then
246+ echo "::warning ::Upload failed for $f; continuing."
247+ FAILED=$((FAILED + 1))
248+ else
249+ UPLOADED=$((UPLOADED + 1))
250+ fi
231251 done
252+ echo "Uploaded : $UPLOADED Skipped (>2 GiB): $SKIPPED_LARGE Failed: $FAILED"
253+ exit 0
232254 fi
233255 env :
234256 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments