Skip to content

Commit 886b943

Browse files
build-meshes: skip >2 GiB files; never abort upload loop on a single error
1 parent ad5ee7b commit 886b943

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

.github/workflows/build-meshes.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff 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 }}

0 commit comments

Comments
 (0)