Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,35 @@ jobs:
fi
} >> "$GITHUB_PATH"

- name: Install create-dmg on macOS
if: runner.os == 'macOS'
run: brew install create-dmg

- name: Configure
run: cmake --preset ${{ matrix.configure_preset }}

- name: Build
run: cmake --build --preset ${{ matrix.build_preset }}

- name: Upload the CI artifact
- name: Create macOS DMG
if: runner.os == 'macOS'
run: create-dmg --background dmgBG.png --volname "Moon Child FE" --window-size 640 375 --icon-size 75 --icon "MoonChildFE.app" 200 275 --app-drop-link 430 275 --hide-extension "MoonChildFE.app" Bin/${{ matrix.artifact_platform }}/Release/MoonChildFE-macOSUniversal.dmg Bin/${{ matrix.artifact_platform }}/Release/

- name: Upload the CI artifact (non-macOS)
uses: actions/upload-artifact@v4
if: runner.os != 'macOS'
with:
name: MoonChildFE-${{ matrix.artifact_platform }}
path: Bin/${{ matrix.artifact_platform }}/Release/
if-no-files-found: error

- name: Upload the CI artifact (macOS)
uses: actions/upload-artifact@v4
if: runner.os == 'macOS'
with:
name: MoonChildFE-${{ matrix.artifact_platform }}
path: Bin/${{ matrix.artifact_platform }}/Release/MoonChildFE-macOSUniversal.dmg
if-no-files-found: error

release:
name: GitHub Release
Expand Down Expand Up @@ -179,7 +196,7 @@ jobs:
(cd assets/WindowsX64 && zip -r "$GITHUB_WORKSPACE/dist/MoonChildFE-WindowsX64.zip" .)
(cd assets/WindowsX86 && zip -r "$GITHUB_WORKSPACE/dist/MoonChildFE-WindowsX86.zip" .)
(cd assets/LinuxX64 && tar -czf "$GITHUB_WORKSPACE/dist/MoonChildFE-LinuxX64.tar.gz" .)
(cd assets/macOSUniversal && zip -r "$GITHUB_WORKSPACE/dist/MoonChildFE-macOSUniversal.zip" .)
(cd assets/macosUniversal && cp MoonChildFE-macOSUniversal.dmg "$GITHUB_WORKSPACE/dist/MoonChildFE-macOSUniversal.dmg" .)

- name: Create the GitHub Release
uses: softprops/action-gh-release@v2
Expand Down
Binary file modified AppIcon.icns
Binary file not shown.
Binary file added Assets.car
Binary file not shown.
9 changes: 8 additions & 1 deletion CMake/Platforms/macOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ target_link_libraries(${EXECUTABLE_NAME} PRIVATE dl)
set_target_properties(${EXECUTABLE_NAME} PROPERTIES
MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTABLE_NAME}
MACOSX_BUNDLE_BUNDLE_VERSION ${CMAKE_PROJECT_VERSION}
MACOSX_BUNDLE_GUI_IDENTIFIER com.teamhoi.${EXECUTABLE_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER com.mors.${EXECUTABLE_NAME}
MACOSX_BUNDLE_ICON_FILE AppIcon.icns
MACOSX_BUNDLE_SHORT_VERSION_STRING ${CMAKE_PROJECT_VERSION}
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/MoonChild.plist.in"
)

add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/AppIcon.icns"
$<TARGET_FILE_DIR:${EXECUTABLE_NAME}>/../Resources/AppIcon.icns
)

add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/Assets.car"
$<TARGET_FILE_DIR:${EXECUTABLE_NAME}>/../Resources/Assets.car
)
36 changes: 36 additions & 0 deletions MoonChild.plist.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIconName</key>
<string>MC ICN TAHOE</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
</dict>
</plist>
Binary file added dmgBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading