Skip to content

Commit

Permalink
[ci] Work on macOS releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Dec 12, 2023
1 parent c6bdf26 commit 3602563
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 32 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/mac-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,31 @@ jobs:
- name: Build
run: |
./ci/developer.build.sh -S "$PWD" -B build-developer
./ci/developer.build.sh -S "$PWD" -B build-developer
m1-package:
name: macOS (AppleSilicon Release)
runs-on: macmini-arm64

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'

- run: |
source ci/osx-package.build.sh
env:
MACOS_ARCH: "aarch64"
- run: |
source ci/osx-package.deploy.sh
env:
MACOS_ARCH: "aarch64"
MAC_ALTOOL_PASSWORD: ${{ secrets.MAC_ALTOOL_PASSWORD }}
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: macos-aarch64
path: |
*.dmg
29 changes: 11 additions & 18 deletions ci/osx-package.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,28 @@ export OSSIA_SDK=/opt/ossia-sdk-$MACOS_ARCH

export SCORE_DIR="$PWD"
export SDK_DIR="$PWD/SDK"
export PATH=/usr/local/bin:$PATH
export XCODE_ROOT=/Applications/Xcode_15.0.app
sudo xcode-select -s $XCODE_ROOT

xcrun /usr/local/bin/cninja -S $PWD -B build macos-release -- \
export PATH=/usr/local/bin:/opt/homebrew/bin:$PATH
if [[ -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

xcrun /usr/local/bin/cninja -S "$PWD" -B build macos-release -- \
-DOSSIA_SDK="$OSSIA_SDK" \
-DCMAKE_INSTALL_PREFIX="$PWD/install"

find . -type f -name 'ossia score' \
| grep '.' \
|| exit 1

(
cd build
echo "Installing OssiaScore: "
xcrun cmake --install . --strip --component OssiaScore
)


(
cd build
echo "Installing Devel: "
xcrun cmake --install . --strip --component Devel --prefix "$SDK_DIR/usr"
)
xcrun cmake --install build --strip --component OssiaScore
xcrun cmake --install build --strip --component Devel --prefix "$SDK_DIR/usr"

ls "$SDK_DIR/usr"

(
echo "./ci/create-sdk-mac.sh"
./ci/create-sdk-mac.sh
)

Expand Down
39 changes: 26 additions & 13 deletions ci/osx-package.deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
export TAG=$GITTAGNOV

export HOMEBREW_NO_AUTO_UPDATE=1
export SRC_PATH=$PWD
export SRC_PATH="$PWD"
brew install graphicsmagick imagemagick create-dmg

cd $SRC_PATH/install/
cd "$SRC_PATH/install/"

# Codesign
sign_app() {
Expand All @@ -19,16 +19,21 @@ sign_app() {
}

echo " === code signing === "
security unlock-keychain -p travis build.keychain
if [[ -f build.keychain ]]; then
security unlock-keychain -p travis build.keychain
fi

sign_app "$SRC_PATH/src/vstpuppet/entitlements.plist" "ossia score.app/Contents/MacOS/ossia-score-vstpuppet.app"
sign_app "$SRC_PATH/src/vst3puppet/entitlements.plist" "ossia score.app/Contents/MacOS/ossia-score-vst3puppet.app"
sign_app "$SRC_PATH/src/app/entitlements.plist" "ossia score.app"

echo " === create dmg === "
# Create a .dmg
cp $SRC_PATH/LICENSE.txt license.txt
security unlock-keychain -p travis build.keychain
cp "$SRC_PATH/LICENSE.txt" license.txt

if [[ -f build.keychain ]]; then
security unlock-keychain -p travis build.keychain
fi

echo killing...; sudo pkill -9 XProtect >/dev/null || true;
echo waiting...; while pgrep XProtect; do sleep 3; done;
Expand All @@ -42,23 +47,31 @@ sudo create-dmg \
--icon "ossia score.app" 200 190 \
--hide-extension "ossia score.app" \
'score.dmg' 'ossia score.app'
ls
export WHOAMI=$(whoami)
sudo chown $WHOAMI *.dmg
echo " === notarize === "

sudo chown "$(whoami)" ./*.dmg

# Notarize the .dmg
security unlock-keychain -p travis build.keychain
echo " === notarize === "
if [[ -f build.keychain ]]; then
security unlock-keychain -p travis build.keychain
fi

xcrun notarytool submit *.dmg \
--team-id "GRW9MHZ724" \
--apple-id "[email protected]" \
--password "$MAC_ALTOOL_PASSWORD" \
--progress \
--wait

xcrun stapler staple *.dmg
xcrun stapler validate *.dmg
# Staple
xcrun stapler staple ./*.dmg
xcrun stapler validate ./*.dmg

[[ $? == 0 ]] || exit 1

mv *.dmg "$BUILD_ARTIFACTSTAGINGDIRECTORY/ossia score-$TAG-macOS.dmg"
# Archive
if [ -z ${BUILD_ARTIFACTSTAGINGDIRECTORY+x} ]; then
BUILD_ARTIFACTSTAGINGDIRECTORY="$PWD"
fi
mv ./*.dmg "$BUILD_ARTIFACTSTAGINGDIRECTORY/ossia score-$TAG-macOS.dmg"
mv "mac-sdk.zip" "$BUILD_ARTIFACTSTAGINGDIRECTORY/"

0 comments on commit 3602563

Please sign in to comment.