release.sh steps for easy Mac OS distribution

This commit is contained in:
Noah 2021-07-11 14:38:26 -07:00
parent d1ef9d2932
commit 456863839e
3 changed files with 40 additions and 10 deletions

View File

@ -5,7 +5,7 @@
<key>CFBundleGetInfoString</key>
<string>Project: Doodle</string>
<key>CFBundleExecutable</key>
<string>doodle</string>
<string>sketchymaze</string>
<key>CFBundleIdentifier</key>
<string>net.kirsle.ProjectDoodle</string>
<key>CFBundleName</key>

View File

@ -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/"

View File

@ -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
# 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