mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
521922353a
* chore: Remove Travis * Travis badge removed * remove travis from build scripts Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com> Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
45 lines
1.0 KiB
Bash
Executable File
45 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# detect CI
|
|
if [ "$SYSTEM_COLLECTIONID" != "" ]; then
|
|
# Azure Pipelines
|
|
CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')"
|
|
CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY"
|
|
elif [ "$HOME" != "" ]; then
|
|
# GitHub Actions
|
|
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
|
|
CI_BUILD_DIR="$GITHUB_WORKSPACE"
|
|
else
|
|
# for executing in non ci environment
|
|
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
|
|
fi
|
|
|
|
function installAndUpgrade()
|
|
{
|
|
arr=("$@")
|
|
for i in "${arr[@]}";
|
|
do
|
|
list_output=`brew list | grep $i`
|
|
outdated_output=`brew outdated | grep $i`
|
|
|
|
if [[ ! -z "$list_output" ]]; then
|
|
if [[ ! -z "$outdated_output" ]]; then
|
|
brew upgrade $i
|
|
fi
|
|
else
|
|
brew install $i
|
|
fi
|
|
done
|
|
}
|
|
|
|
# install osx deps for hyperion compile
|
|
if [[ $CI_NAME == 'osx' || $CI_NAME == 'darwin' ]]; then
|
|
echo "Install dependencies"
|
|
brew update
|
|
dependencies=("qt5" "python" "libusb" "cmake" "doxygen")
|
|
installAndUpgrade "${dependencies[@]}"
|
|
elif [[ $CI_NAME != 'linux' ]]; then
|
|
echo "Unsupported platform: $CI_NAME"
|
|
exit 5
|
|
fi
|