diff --git a/.github/actions/cleanup-space/action.yml b/.github/actions/cleanup-space/action.yml index 037435f98..78b5a75ee 100644 --- a/.github/actions/cleanup-space/action.yml +++ b/.github/actions/cleanup-space/action.yml @@ -8,9 +8,31 @@ runs: shell: bash run: | echo "Removing large toolsets to free up disk space..." + echo "Disk space before cleanup:" + df -h + # Remove dotnet to save disk space. sudo rm -rf /usr/share/dotnet # Remove android to save disk space. sudo rm -rf /usr/local/lib/android # Remove ghc to save disk space. sudo rm -rf /opt/ghc + # Remove large packages. + sudo rm -rf /usr/share/swift + sudo rm -rf /usr/local/julia* + sudo rm -rf /opt/hostedtoolcache + + # Remove docker images to save space. + docker image prune -a -f || true + + # Remove large apt packages. + sudo apt-get remove -y '^aspnetcore-.*' '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri 2>/dev/null || true + sudo apt-get autoremove -y + sudo apt-get clean + + # Remove caches. + sudo rm -rf /usr/local/share/boost + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + echo "Disk space after cleanup:" + df -h diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 974ff84ae..0e450de38 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,7 +28,7 @@ jobs: fetch-depth: 0 - name: cleanup space - run: rm -rf /opt/hostedtoolcache && mkdir -p /opt/hostedtoolcache/go + uses: ./.github/actions/cleanup-space - name: setup go ${{ env.GO_VERSION }} uses: actions/setup-go@v5 diff --git a/scripts/release.sh b/scripts/release.sh index 3ae8c1ec7..56b7c3cb3 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -193,6 +193,9 @@ required Go version ($goversion)." env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lncli popd + # Clear Go build cache to prevent disk space issues during multi-platform builds. + go clean -cache + # Add the hashes for the individual binaries as well for easy verification # of a single installed binary. shasum -a 256 "${dir}/"* >> "manifest-$tag.txt"