diff --git a/etc/macos/Sketchy Maze.app/Contents/Info.plist b/etc/macos/Sketchy Maze.app/Contents/Info.plist index f32e901..b6555cc 100644 --- a/etc/macos/Sketchy Maze.app/Contents/Info.plist +++ b/etc/macos/Sketchy Maze.app/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleGetInfoString Project: Doodle CFBundleExecutable - doodle + sketchymaze CFBundleIdentifier net.kirsle.ProjectDoodle CFBundleName diff --git a/scripts/mac-app.sh b/scripts/mac-app.sh index eb9083d..e1f6c29 100755 --- a/scripts/mac-app.sh +++ b/scripts/mac-app.sh @@ -6,10 +6,10 @@ VERSION=`grep -e 'Version =' ../../pkg/branding/branding.go | head -n 1 | cut -d '"' -f 2` INSTALL_ROOT="/opt/sketchy-maze" APP_NAME="Sketchy Maze.app" -APP_FOLDER="../../etc/macos/$APP_NAME" +APP_FOLDER="../../../../etc/macos/$APP_NAME" APP_CONTENTS="$APP_NAME/Contents" -if [[ ! -f "./doodle" ]]; then +if [[ ! -f "./sketchymaze" ]]; then echo Run this script from the directory containing the Doodle binary. echo This is usually at /dist/doodle-VERSION/ relative to the git root. exit 1 @@ -28,5 +28,5 @@ mkdir -p "$APP_CONTENTS/MacOS" mkdir -p "$APP_CONTENTS/Resources" # Copy binaries to /MacOS -cp doodle doodad "$APP_CONTENTS/MacOS/" -rsync -av ./ --exclude doodle --exclude doodad --exclude "$APP_NAME" "$APP_CONTENTS/Resources/" +cp sketchymaze doodad "$APP_CONTENTS/MacOS/" +rsync -av ./ --exclude sketchymaze --exclude doodad --exclude "$APP_NAME" "$APP_CONTENTS/Resources/" diff --git a/scripts/release.sh b/scripts/release.sh index 6d20987..deecef3 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -5,9 +5,10 @@ # folder into Linux and Windows versions and zip them up # for release. # -# For Mac OS releases, after `make dist` run `release-osx.sh` -# instead. - +# If run on a Mac OS system, it runs only the Mac OS code +# path; it does not expect any Windows .exe files or .dll's, +# the dist folder should be a Mac only build of the game. +# # Add the user-level "gem install fpm" to the $PATH. # Might need fixing over time. export PATH="$PATH:$HOME/.local/share/gem/ruby/3.0.0/bin" @@ -77,6 +78,35 @@ windows() { zip -r "${RELEASE_PATH}/windows/sketchymaze-${VERSION}-windows-64bit.zip" . cd - } +macos() { + # Check for OSX binaries in the dist folder. + if [[ ! -f "${DIST_PATH}/doodad" ]]; then + echo No binaries found, skipping Mac release. + return + fi -linux -windows \ No newline at end of file + # Prepare the OSX release. + mkdir -p ${STAGE_PATH} "${RELEASE_PATH}/macos" + cp -r $DIST_PATH "${STAGE_PATH}/macos" + cd "$STAGE_PATH/macos" + + # Zip it. + zip -r "${RELEASE_PATH}/macos/sketchymaze-${VERSION}-macos-x64.zip" . + + # Create the .app bundle. + ../../../../scripts/mac-app.sh + + # Remove redundant Mac binaries from stage folder. + rm ./sketchymaze ./doodad + hdiutil create "${RELEASE_PATH}/macos/sketchymaze-${VERSION}-macOS-x64.dmg" \ + -ov -volname "SketchyMaze" -fs HFS+ -srcfolder $(pwd) + + cd - +} + +if [[ `uname` == "Darwin" ]]; then + macos +else + linux + windows +fi