From 440feb564b0c66baceb5ee6a2fea26c1592b52c5 Mon Sep 17 00:00:00 2001 From: liudonghua Date: Mon, 9 Sep 2024 02:04:55 +0000 Subject: [PATCH] release some disk spaces for macos build see also https://github.com/orgs/community/discussions/137481#discussioncomment-10578608, https://github.com/actions/runner-images/issues/2840, https://github.com/maxim-lobanov/setup-xcode/issues/84 --- .github/workflows/node-build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/node-build.yml b/.github/workflows/node-build.yml index 5517c9a..a2d90d8 100644 --- a/.github/workflows/node-build.yml +++ b/.github/workflows/node-build.yml @@ -114,6 +114,22 @@ jobs: - name: Initialization for ${{ env.tag_name }} ... run: | echo ok! + - name: Release some disk spaces for macos build, remove old xcode versions ... + if: startsWith(matrix.os, 'macos') + run: | + echo "Disk spaces before cleanup" + sudo df -h + sudo du -sh /* + echo "Searching for Xcode versions:" + find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1 + # https://github.com/actions/runner-images/issues/2840#issuecomment-2334584217 + echo "Remove all but the latest Xcode..." + find /Applications/ -name "Xcode*" | sort -r | tail --lines=+2 | xargs rm -rf + echo "Available Xcode versions after removal:" + find /Applications -name "Xcode_*" -maxdepth 1 -mindepth 1 + echo "Disk spaces after cleanup" + sudo df -h + sudo du -sh /* - name: Building for linux ... if: startsWith(matrix.os, 'ubuntu') run: |