diff --git a/.github/assets/maid.dmg b/.github/assets/maid.dmg new file mode 100644 index 00000000..902a9737 Binary files /dev/null and b/.github/assets/maid.dmg differ diff --git a/.github/scripts/create_dmg.sh b/.github/scripts/create_dmg.sh index 65416e81..e1f4b061 100755 --- a/.github/scripts/create_dmg.sh +++ b/.github/scripts/create_dmg.sh @@ -4,112 +4,25 @@ set -e APP_NAME="maid" APP_DIR="build/macos/Build/Products/Release/${APP_NAME}.app" -DMG_DIR="dmg" +DMG_TEMPLATE="./.github/assets/maid.dmg" +DMG_OUTPUT="./dmg/${APP_NAME}.dmg" TMP_MOUNT="/tmp/Maid" -DMG_BACKGROUND_IMG="./media/dmg.png" -WINX=0 -WINY=0 -WINW=700 -WINH=1000 -ICON_SIZE=64 -TEXT_SIZE=12 -# Create the dmg and app directories if they do not exist -mkdir -p ${DMG_DIR} +# Create the dmg directory if it does not exist +mkdir -p "$(dirname ${DMG_OUTPUT})" mkdir -p ${TMP_MOUNT} -# Create temporary DMG -hdiutil create ${DMG_DIR}/${APP_NAME}_tmp.dmg -volname "${APP_NAME}" -srcfolder "${APP_DIR}" -ov -format UDRW +# Mount the template DMG +hdiutil attach ${DMG_TEMPLATE} -mountpoint ${TMP_MOUNT} -nobrowse -noverify -noautoopen -# Mount the temporary DMG -hdiutil attach ${DMG_DIR}/${APP_NAME}_tmp.dmg -mountpoint ${TMP_MOUNT} +# Replace the TARGET file with maid.app +rm -rf "${TMP_MOUNT}/TARGET" +cp -R "${APP_DIR}" "${TMP_MOUNT}/maid.app" -# Copy background image -mkdir -p ${TMP_MOUNT}/.background -cp ${DMG_BACKGROUND_IMG} ${TMP_MOUNT}/.background/feature.png - -# Create a symbolic link to the Applications folder -ln -s /Applications ${TMP_MOUNT}/Applications - -# AppleScript to set DMG properties -osascript < -