From 5c5d37dbc3b70316fc35a9e3f4ad6e98f8b615ff Mon Sep 17 00:00:00 2001 From: Gonzalo Exequiel Pedone Date: Fri, 23 Aug 2024 13:40:35 -0300 Subject: [PATCH] Updated builds 2. --- ports/ci/linux-mingw/deploy.sh | 18 ++++++++++++++++++ ports/ci/mac/deploy.sh | 27 ++++++++++++++++++++++----- ports/ci/windows-msys/deploy.sh | 18 ++++++++++++++++++ ports/ci/windows-vs/deploy.bat | 16 +++++++++++----- 4 files changed, 69 insertions(+), 10 deletions(-) diff --git a/ports/ci/linux-mingw/deploy.sh b/ports/ci/linux-mingw/deploy.sh index e0812db..aa4bde8 100644 --- a/ports/ci/linux-mingw/deploy.sh +++ b/ports/ci/linux-mingw/deploy.sh @@ -18,6 +18,24 @@ # # Web-Site: http://webcamoid.github.io/ +if [ ! -z "${GITHUB_SHA}" ]; then + export GIT_COMMIT_HASH="${GITHUB_SHA}" +elif [ ! -z "${CIRRUS_CHANGE_IN_REPO}" ]; then + export GIT_COMMIT_HASH="${CIRRUS_CHANGE_IN_REPO}" +fi + +export GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) + +if [ -z "${GIT_BRANCH_NAME}" ]; then + if [ ! -z "${GITHUB_REF_NAME}" ]; then + export GIT_BRANCH_NAME="${GITHUB_REF_NAME}" + elif [ ! -z "${CIRRUS_BRANCH}" ]; then + export GIT_BRANCH_NAME="${CIRRUS_BRANCH}" + else + export GIT_BRANCH_NAME=master + fi +fi + git clone https://github.com/webcamoid/DeployTools.git cat << EOF > package_info_strip.conf diff --git a/ports/ci/mac/deploy.sh b/ports/ci/mac/deploy.sh index d7211e3..48b2b7c 100644 --- a/ports/ci/mac/deploy.sh +++ b/ports/ci/mac/deploy.sh @@ -18,14 +18,31 @@ # # Web-Site: http://webcamoid.github.io/ -SOURCES_DIR=${PWD} +if [ ! -z "${GITHUB_SHA}" ]; then + export GIT_COMMIT_HASH="${GITHUB_SHA}" +elif [ ! -z "${CIRRUS_CHANGE_IN_REPO}" ]; then + export GIT_COMMIT_HASH="${CIRRUS_CHANGE_IN_REPO}" +fi + +export GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) + +if [ -z "${GIT_BRANCH_NAME}" ]; then + if [ ! -z "${GITHUB_REF_NAME}" ]; then + export GIT_BRANCH_NAME="${GITHUB_REF_NAME}" + elif [ ! -z "${CIRRUS_BRANCH}" ]; then + export GIT_BRANCH_NAME="${CIRRUS_BRANCH}" + else + export GIT_BRANCH_NAME=master + fi +fi + git clone https://github.com/webcamoid/DeployTools.git -export INSTALL_PREFIX="${SOURCES_DIR}/package-data" -export PACKAGES_DIR="${SOURCES_DIR}/packages/mac" -export PYTHONPATH="${SOURCES_DIR}/DeployTools" -export BUILD_PATH="${SOURCES_DIR}/build" +export INSTALL_PREFIX="${PWD}/package-data" +export PACKAGES_DIR="${PWD}/packages/mac" +export PYTHONPATH="${PWD}/DeployTools" +export BUILD_PATH="${PWD}/build" python3 ./DeployTools/deploy.py \ -d "${INSTALL_PREFIX}" \ -c "${BUILD_PATH}/package_info.conf" \ diff --git a/ports/ci/windows-msys/deploy.sh b/ports/ci/windows-msys/deploy.sh index ade2ab4..7ac4b95 100644 --- a/ports/ci/windows-msys/deploy.sh +++ b/ports/ci/windows-msys/deploy.sh @@ -18,6 +18,24 @@ # # Web-Site: http://webcamoid.github.io/ +if [ ! -z "${GITHUB_SHA}" ]; then + export GIT_COMMIT_HASH="${GITHUB_SHA}" +elif [ ! -z "${CIRRUS_CHANGE_IN_REPO}" ]; then + export GIT_COMMIT_HASH="${CIRRUS_CHANGE_IN_REPO}" +fi + +export GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) + +if [ -z "${GIT_BRANCH_NAME}" ]; then + if [ ! -z "${GITHUB_REF_NAME}" ]; then + export GIT_BRANCH_NAME="${GITHUB_REF_NAME}" + elif [ ! -z "${CIRRUS_BRANCH}" ]; then + export GIT_BRANCH_NAME="${CIRRUS_BRANCH}" + else + export GIT_BRANCH_NAME=master + fi +fi + git clone https://github.com/webcamoid/DeployTools.git export PATH="/c/Program Files (x86)/NSIS:/c/msys64/mingw64/bin:/mingw64/bin:${PATH}" diff --git a/ports/ci/windows-vs/deploy.bat b/ports/ci/windows-vs/deploy.bat index 8d8a391..738b565 100644 --- a/ports/ci/windows-vs/deploy.bat +++ b/ports/ci/windows-vs/deploy.bat @@ -16,14 +16,20 @@ REM along with akvirtualcamera. If not, see . REM REM Web-Site: http://webcamoid.github.io/ -set SOURCES_DIR=%cd% -set INSTALL_PREFIX=%SOURCES_DIR%\package-data -set PACKAGES_DIR=%SOURCES_DIR%\packages\windows +if not "%GITHUB_SHA%" == "" set GIT_COMMIT_HASH="%GITHUB_SHA%" +if not "%CIRRUS_CHANGE_IN_REPO%" == "" set GIT_COMMIT_HASH="%CIRRUS_CHANGE_IN_REPO%" + +if not "%GITHUB_REF_NAME%" == "" set GIT_BRANCH_NAME="%GITHUB_REF_NAME%" +if not "%CIRRUS_BRANCH%" == "" set GIT_BRANCH_NAME="%CIRRUS_BRANCH%" +if not "%GIT_BRANCH_NAME%" == "" set GIT_BRANCH_NAME=master git clone https://github.com/webcamoid/DeployTools.git -set PYTHONPATH=%cd%\DeployTools -set BUILD_PATH=%cd%\build-x64 +set INSTALL_PREFIX=%CD%\package-data +set PACKAGES_DIR=%CD%\packages\windows +set BUILD_PATH=%CD%\build-x64 +set PYTHONPATH=%CD%\DeployTools + python DeployTools\deploy.py ^ -d "%INSTALL_PREFIX%" ^ -c "%BUILD_PATH%\package_info.conf" ^