Skip to content

Commit

Permalink
Added macOS build script
Browse files Browse the repository at this point in the history
  • Loading branch information
gbevin committed Apr 11, 2024
1 parent fa9f76c commit 29eb5a6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Builds/MacOSX/receivemidi.xcodeproj/project.xcworkspace/xcuserdata
/Builds/VisualStudio2017/.vs
/Builds/VisualStudio2017/x64
/Builds/VisualStudio2017/receivemidi_ConsoleApp.vcxproj.user
Installers
45 changes: 45 additions & 0 deletions Scripts/build-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

if [ $# -eq 0 ]; then
echo "The release version is required as an argument"
exit 1
fi

PROJECT_DIR=$PWD

export RELEASE_VERSION="$1"
export PATH_TO_JUCE="$PROJECT_DIR/JUCE"

SIGN_ID="Developer ID Application: Uwyn, LLC (AGZT8GVS7G)"
BUILD_DIR="$PWD/Builds/MacOSX/build"
INSTALLERS_DIR="$PROJECT_DIR/Installers"
PKG_FILE="receivemidi-macos-${RELEASE_VERSION}.pkg"
ARCHIVE_FILE="$INSTALLERS_DIR/receivemidi-macOS-${RELEASE_VERSION}.zip"

rm -rfv "$BUILD_DIR"
mkdir -v "$INSTALLERS_DIR"

# build release artifacts
echo "Building all ProJucer artifacts"
xcodebuild -project ./Builds/MacOSX/receivemidi.xcodeproj -config Release SYMROOT=build -scheme "receivemidi - ConsoleApp"

# sign each individual artifact
echo "Codesigning all artifacts"
codesign -f -s "$SIGN_ID" "${BUILD_DIR}/Release/receivemidi" --deep --strict --timestamp --options=runtime

# build the installer package in the build directory
echo "Building installer package"
pkgbuild --root "${BUILD_DIR}/Release" --identifier com.uwyn.receivemidi --version ${RELEASE_VERSION} --install-location /usr/local/bin --sign "Developer ID Installer: Uwyn, LLC (AGZT8GVS7G)" "${BUILD_DIR}/${PKG_FILE}"

# Notarization
echo "Notarizating installer"
xcrun notarytool submit "${BUILD_DIR}/${PKG_FILE}" --keychain-profile "notary-uwyn.com" --wait
xcrun stapler staple "${BUILD_DIR}/${PKG_FILE}"
spctl --assess -vv --type install "${PKG_FILE}"

echo "Creating zip archive of installer"
pushd "${BUILD_DIR}"
zip -r "${ARCHIVE_FILE}" "${PKG_FILE}"
popd

echo "Finished building `realpath $ARCHIVE_FILE`"

0 comments on commit 29eb5a6

Please # to comment.