1212 description : " Rebuild ALL meshes (ignore git diff)?"
1313 required : false
1414 default : " false"
15+ max_msh_mb :
16+ description : " Max .msh size in MiB; files above this are skipped"
17+ required : false
18+ default : " 1024"
1519
1620jobs :
1721 build-meshes :
@@ -225,21 +229,35 @@ jobs:
225229 echo "Nothing to upload."
226230 else
227231 # 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 .
232+ # failed upload. Two size gates:
233+ # * MAX_MB : practical limit from the workflow input (default 1 GiB)
234+ # * HARD : GitHub's hard 2 GiB-per-asset cap .
231235 set +e
232- MAX_SIZE=$((2 * 1024 * 1024 * 1024)) # 2 GiB
236+ MAX_MB=${{ github.event.inputs.max_msh_mb || '1024' }}
237+ MAX_MB_BYTES=$((MAX_MB * 1024 * 1024))
238+ HARD=$((2 * 1024 * 1024 * 1024)) # 2 GiB
233239 FAILED=0
234- SKIPPED_LARGE=0
240+ SKIPPED_PRACTICAL=0
241+ SKIPPED_HARD=0
235242 UPLOADED=0
236243 for f in release_assets/*; do
237244 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))
245+ if [[ -n "$SZ" && $SZ -ge $HARD ]]; then
246+ echo "::warning ::$(basename "$f") is ${SZ} bytes, above GitHub's 2 GiB hard cap — skipping."
247+ SKIPPED_HARD =$((SKIPPED_HARD + 1))
241248 continue
242249 fi
250+ # Apply the practical cap only to .msh/.h5 artefacts — .geo
251+ # sources are always small and never trip this.
252+ if [[ -n "$SZ" && $SZ -ge $MAX_MB_BYTES ]]; then
253+ case "$f" in
254+ *.msh|*.h5)
255+ echo "::warning ::$(basename "$f") is $((SZ / 1024 / 1024)) MiB (max_msh_mb=$MAX_MB) — skipping."
256+ SKIPPED_PRACTICAL=$((SKIPPED_PRACTICAL + 1))
257+ continue
258+ ;;
259+ esac
260+ fi
243261 echo "Uploading : $f"
244262 gh release upload "$TAG" "$f" --clobber
245263 if [[ $? -ne 0 ]]; then
@@ -249,7 +267,7 @@ jobs:
249267 UPLOADED=$((UPLOADED + 1))
250268 fi
251269 done
252- echo "Uploaded : $UPLOADED Skipped (>2 GiB): $SKIPPED_LARGE Failed: $FAILED"
270+ echo "Uploaded : $UPLOADED Skipped (>${MAX_MB} MiB): $SKIPPED_PRACTICAL Skipped (> 2 GiB hard ): $SKIPPED_HARD Failed: $FAILED"
253271 exit 0
254272 fi
255273 env :
0 commit comments