Skip to content

Commit

Permalink
[ci] macOS build scripts improvement, revert to 10.15 min for MacIntel
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Dec 23, 2023
1 parent d1e961b commit 8192b11
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/mac-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
./ci/osx-brew.build.sh
brew-m1:
# Disabled until we manage to set-up proper macOS VMs to not pollute host with homebrew
if: false
name: macOS (Release, Brew, AppleSilicon)
runs-on: macmini-arm64

Expand All @@ -44,6 +46,8 @@ jobs:
./ci/osx-brew.build.sh
brew-m1-dev:
# Disabled until we manage to set-up proper macOS VMs to not pollute host with homebrew
if: false
name: macOS (Dev, Brew, AppleSilicon)
runs-on: macmini-arm64

Expand Down
12 changes: 11 additions & 1 deletion ci/osx-package.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ export OSSIA_SDK=/opt/ossia-sdk-$MACOS_ARCH
export SCORE_DIR="$PWD"
export SDK_DIR="$PWD/SDK"
export PATH=/usr/local/bin:/opt/homebrew/bin:$PATH
if [[ -d /Applications/Xcode_15.0.app ]]; then

if [[ -d /Applications/Xcode_15.1.app ]]; then
export XCODE_ROOT=/Applications/Xcode_15.1.app
sudo xcode-select -s "$XCODE_ROOT"
elif [[ -d /Applications/Xcode_15.0.app ]]; then
export XCODE_ROOT=/Applications/Xcode_15.0.app
sudo xcode-select -s "$XCODE_ROOT"
else
export XCODE_ROOT=/Applications/Xcode.app
fi

if [[ "$MACOS_ARCH" = "x86_64" ]]; then
export CNINJA_TOOLCHAIN=macos-release-10.15
else
export CNINJA_TOOLCHAIN=macos-release-11.0
fi

xcrun /usr/local/bin/cninja -S "$PWD" -B build macos-release -- \
-DOSSIA_SDK="$OSSIA_SDK" \
-DCMAKE_INSTALL_PREFIX="$PWD/install"
Expand Down
20 changes: 10 additions & 10 deletions ci/osx-package.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
set +x
KEY_CHAIN=build.keychain

security create-keychain -p travis $KEY_CHAIN
security default-keychain -s $KEY_CHAIN
security unlock-keychain -p travis $KEY_CHAIN
security create-keychain -p travis "$KEY_CHAIN"
security default-keychain -s "$KEY_CHAIN"
security unlock-keychain -p travis "$KEY_CHAIN"

security import $CODESIGN_SECUREFILEPATH -k $KEY_CHAIN -P $MAC_CODESIGN_PASSWORD -T /usr/bin/codesign > /dev/null 2>&1
security set-key-partition-list -S apple-tool:,apple: -s -k travis $KEY_CHAIN > /dev/null 2>&1
security import "$CODESIGN_SECUREFILEPATH" -k "$KEY_CHAIN" -P "$MAC_CODESIGN_PASSWORD" -T /usr/bin/codesign > /dev/null 2>&1
security set-key-partition-list -S apple-tool:,apple: -s -k travis "$KEY_CHAIN" > /dev/null 2>&1

rm -rf $CODESIGN_SECUREFILEPATH
rm -rf "$CODESIGN_SECUREFILEPATH"
)

set +e
Expand All @@ -25,12 +25,12 @@ brew install gnu-tar ninja
wget -nv https://github.com/jcelerier/cninja/releases/download/v3.7.9/cninja-v3.7.9-macOS.tar.gz -O cninja.tgz &

SDK_ARCHIVE=sdk-macOS-$MACOS_ARCH.tar.gz
wget -nv https://github.com/ossia/score-sdk/releases/download/sdk30/$SDK_ARCHIVE -O $SDK_ARCHIVE
sudo mkdir -p /opt/ossia-sdk-$MACOS_ARCH/
wget -nv https://github.com/ossia/score-sdk/releases/download/sdk30/$SDK_ARCHIVE -O "$SDK_ARCHIVE"
sudo mkdir -p "/opt/ossia-sdk-$MACOS_ARCH/"
sudo chown -R $(whoami) /opt
sudo chmod -R a+rwx /opt
gtar xhaf $SDK_ARCHIVE --strip-components=2 --directory /opt/ossia-sdk-$MACOS_ARCH/
ls /opt/ossia-sdk-$MACOS_ARCH/
gtar xhaf "$SDK_ARCHIVE" --strip-components=2 --directory "/opt/ossia-sdk-$MACOS_ARCH/"
ls "/opt/ossia-sdk-$MACOS_ARCH/"

sudo rm -rf /Library/Developer/CommandLineTools
sudo rm -rf /usr/local/include/c++
Expand Down

0 comments on commit 8192b11

Please sign in to comment.