mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-11 18:01:14 +00:00
Free macOS Disk Space Only When the Build Might Not Fit (#16364)
This commit is contained in:
@@ -179,6 +179,13 @@ jobs:
|
||||
if: runner.os == 'macOS' && !inputs.macos-combine-only && !vars.SELF_HOSTED
|
||||
run: |
|
||||
df -hI /
|
||||
# Deleting the unused Xcodes takes minutes, so only do it when the
|
||||
# build might not fit. A cold build uses under 4 GiB after this step.
|
||||
avail_gib=$(df -g / | awk 'NR == 2 { print $4 }')
|
||||
if [ "$avail_gib" -ge 15 ]; then
|
||||
echo "$avail_gib GiB free, enough for the build"
|
||||
exit 0
|
||||
fi
|
||||
# Keep only the selected Xcode
|
||||
xcode=$(basename "$(cd "$(xcode-select -p)/../.." && pwd -P)")
|
||||
sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "$xcode" -exec rm -rf {} +
|
||||
|
||||
Reference in New Issue
Block a user