From 8bd604f633099430b0c29d27a6e7fe2c49d06cdf Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 2 Jan 2024 15:54:49 +0800 Subject: [PATCH] GHA CI: add fallback URL for boost library Boost main download site jfrog is unavailable at the time of writing. Related: https://github.com/boostorg/boost/issues/842 PR #20218. --- .github/workflows/ci_macos.yaml | 14 +++++++++----- .github/workflows/ci_ubuntu.yaml | 14 +++++++++----- .github/workflows/ci_windows.yaml | 12 ++++++++---- .github/workflows/coverity-scan.yaml | 14 +++++++++----- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci_macos.yaml b/.github/workflows/ci_macos.yaml index 4e077a37d..7b14d4040 100644 --- a/.github/workflows/ci_macos.yaml +++ b/.github/workflows/ci_macos.yaml @@ -52,11 +52,15 @@ jobs: - name: Install boost run: | - curl \ - -L \ - -o "${{ runner.temp }}/boost.tar.gz" \ - "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz" - tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.." + boost_url="https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz" + boost_url2="https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.gz" + set +e + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url" + tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?" + if [ "$_exitCode" -ne "0" ]; then + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2" + tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?" + fi mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}" - name: Install Qt diff --git a/.github/workflows/ci_ubuntu.yaml b/.github/workflows/ci_ubuntu.yaml index 7b42b4e37..92003b69c 100644 --- a/.github/workflows/ci_ubuntu.yaml +++ b/.github/workflows/ci_ubuntu.yaml @@ -48,11 +48,15 @@ jobs: - name: Install boost run: | - curl \ - -L \ - -o "${{ runner.temp }}/boost.tar.gz" \ - "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz" - tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.." + boost_url="https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz" + boost_url2="https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.gz" + set +e + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url" + tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?" + if [ "$_exitCode" -ne "0" ]; then + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2" + tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?" + fi mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}" - name: Install Qt diff --git a/.github/workflows/ci_windows.yaml b/.github/workflows/ci_windows.yaml index 82dcec0fa..9e4368651 100644 --- a/.github/workflows/ci_windows.yaml +++ b/.github/workflows/ci_windows.yaml @@ -79,11 +79,15 @@ jobs: - name: Install boost run: | - curl ` - -L ` - -o "${{ runner.temp }}/boost.tar.gz" ` - "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz" + $boost_url="https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz" + $boost_url2="https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.gz" + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url" tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.." + if ($LastExitCode -ne 0) + { + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2" + tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.." + } move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}" - name: Install Qt diff --git a/.github/workflows/coverity-scan.yaml b/.github/workflows/coverity-scan.yaml index 6a53fbda5..f984b95b3 100644 --- a/.github/workflows/coverity-scan.yaml +++ b/.github/workflows/coverity-scan.yaml @@ -36,11 +36,15 @@ jobs: - name: Install boost run: | - curl \ - -L \ - -o "${{ runner.temp }}/boost.tar.gz" \ - "https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz" - tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.." + boost_url="https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz" + boost_url2="https://sourceforge.net/projects/boost/files/boost/1.84.0/boost_1_84_0.tar.gz" + set +e + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url" + tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?" + if [ "$_exitCode" -ne "0" ]; then + curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2" + tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?" + fi mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}" - name: Install Qt