From 3ae72a3e9950536dcb54b1c068470c52e169d8d9 Mon Sep 17 00:00:00 2001 From: Chen Gong Date: Sat, 15 Jan 2022 23:37:51 +0800 Subject: [PATCH] fix(ci): no hardcoded boost version in ci scripts --- action-install-macos.sh | 9 +++++++-- action-install-windows.bat | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/action-install-macos.sh b/action-install-macos.sh index a619a1a12..94d7999de 100755 --- a/action-install-macos.sh +++ b/action-install-macos.sh @@ -1,10 +1,15 @@ #!/bin/bash +export boost_version="${boost_version=1.75.0}" +boost_x_y_z="${boost_version//./_}" + +export BOOST_ROOT="${BOOST_ROOT=$(pwd)/thirdparty/src/boost_${boost_x_y_z}}" + +# TODO: cache dependencies + # install and build boost make xcode/thirdparty/boost -export BOOST_ROOT="$(pwd)/thirdparty/src/boost_1_75_0" - make xcode/thirdparty if [[ -n "${RIME_PLUGINS}" ]]; then diff --git a/action-install-windows.bat b/action-install-windows.bat index bbab6d028..1c7b1bf37 100644 --- a/action-install-windows.bat +++ b/action-install-windows.bat @@ -1,10 +1,19 @@ setlocal -set boost_version=1_76_0 -aria2c https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_%boost_version%.7z -d C:\Libraries + +if not defined boost_version set boost_version=1.76.0 +set boost_x_y_z=%boost_version:.=_% + +if not defined BOOST_ROOT set BOOST_ROOT=C:\Libraries\boost_%boost_x_y_z% + +if exist "%BOOST_ROOT%\boost" goto boost_found +rem download boost source +aria2c https://boostorg.jfrog.io/artifactory/main/release/%boost_version%/source/boost_%boost_x_y_z%.7z -d C:\Libraries pushd C:\Libraries -7z x boost_%boost_version%.7z +7z x boost_%boost_x_y_z%.7z popd C:\Libraries -set BOOST_ROOT=C:\Libraries\boost_%boost_version% +:boost_found + +rem TODO: cache dependencies call build.bat boost if errorlevel 1 goto error