Unverified Commit cdd6c870 authored by Isuru Fernando's avatar Isuru Fernando Committed by GitHub
Browse files

Merge pull request #393 from radarhere/sdk

Simplified code
parents 8be8042f ea4adc23
...@@ -2,22 +2,13 @@ ...@@ -2,22 +2,13 @@
# Wheel build, install, run test steps on OSX # Wheel build, install, run test steps on OSX
set -e set -e
function check_sdk_11 {
ver="$(xcrun -show-sdk-version)"
if [[ "${ver}" == "" || "${ver}" == 10.* ]]; then
echo "not found"
else
echo "found"
fi
}
if [ "$PLAT" == "arm64" ] || [ "$PLAT" == "universal2" ]; then if [ "$PLAT" == "arm64" ] || [ "$PLAT" == "universal2" ]; then
if [[ "$(check_sdk_11)" == "not found" ]]; then if [[ "$(xcrun --sdk macosx --show-sdk-version | cut -d '.' -f 1)" -lt 11 ]]; then
latestXcode=$(ls /Applications | grep Xcode[_0-9\.]*\.app | sort -V | tail -n 1) latestXcode=$(ls /Applications | grep Xcode[_0-9\.]*\.app | sort -V | tail -n 1)
if ([ "$GITHUB_WORKFLOW" != "" ] || [ "$PIPELINE_WORKSPACE" != "" ]) && [ $latestXcode ]; then if ([ "$GITHUB_WORKFLOW" != "" ] || [ "$PIPELINE_WORKSPACE" != "" ]) && [ $latestXcode ]; then
sudo xcode-select -switch /Applications/$latestXcode sudo xcode-select -switch /Applications/$latestXcode
fi fi
if [[ "$(check_sdk_11)" == "not found" ]]; then if [[ "$(xcrun --sdk macosx --show-sdk-version | cut -d '.' -f 1)" -lt 11 ]]; then
echo "Need SDK>=11 for arm64 builds. Please run xcode-select to select a newer SDK" echo "Need SDK>=11 for arm64 builds. Please run xcode-select to select a newer SDK"
exit 1 exit 1
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment