From b0bbde007362ba95d2f3b3d8c29e7055910b5258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 23 Nov 2025 01:35:44 +0200 Subject: [PATCH] github: Cache the gnu make tarball This avoids breaking the build if the gnu download server is unavailable. --- .github/workflows/build.yml | 17 +++++++++++++++++ build-make.sh | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9f1500..608939a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -411,6 +411,16 @@ jobs: - uses: actions/download-artifact@v4 with: name: profile + - name: Cache downloads + id: cache-tarballs + uses: actions/cache@v4 + with: + path: /opt/cache + key: tarballs-${{ hashFiles('build-make.sh') }} + - name: Restore cache + if: steps.cache-tarballs.outputs.cache-hit != '' + run: | + ln -s /opt/cache/*.tar.* . - name: Build env: LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}} @@ -427,6 +437,13 @@ jobs: NAME=llvm-mingw-$TAG-${{matrix.crt}}-${{matrix.arch}} mv llvm-mingw $NAME zip -9rq ../$NAME.zip $NAME + - name: Save cache + if: steps.cache-tarballs.outputs.cache-hit != 'true' + run: | + mkdir -p /opt/cache + for i in make-*.tar.*; do + if [ ! -L $i ]; then cp -a $i /opt/cache; fi + done - uses: actions/upload-artifact@v4 with: name: windows-${{matrix.crt}}-${{matrix.arch}}-toolchain diff --git a/build-make.sh b/build-make.sh index 7cad409..cca3cf3 100755 --- a/build-make.sh +++ b/build-make.sh @@ -52,7 +52,9 @@ download() { } if [ ! -d make-$MAKE_VERSION ]; then - download https://ftpmirror.gnu.org/gnu/make/make-$MAKE_VERSION.tar.gz + if [ ! -e make-$MAKE_VERSION.tar.gz ]; then + download https://ftpmirror.gnu.org/gnu/make/make-$MAKE_VERSION.tar.gz + fi tar -zxf make-$MAKE_VERSION.tar.gz fi