diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e275179d..f55e127b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,17 +92,16 @@ jobs: path: ./build-cmake - name: Create Package run: | - mkdir ghostship-release - mv build-cmake/Ghostship ghostship-release/ - mv build-cmake/ghostship.o2r ghostship-release/ - mv config.yml ghostship-release/ - mv assets ghostship-release/ - curl -o ghostship-release/gamecontrollerdb.txt -sSL 'https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt' + (cd build-cmake && cpack) + mv _packages/*.dmg Ghostship.dmg + mv README.md readme.txt - name: Publish packaged artifacts uses: actions/upload-artifact@v4 with: - name: ghostship-mac-x64 - path: ghostship-release + name: ghostship-mac + path: | + Ghostship.dmg + readme.txt build-linux: needs: generate-port-o2r diff --git a/CMakeLists.txt b/CMakeLists.txt index c74a973b..251743e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -647,6 +647,9 @@ add_custom_target( COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/ghostship.o2r" "${CMAKE_BINARY_DIR}/ghostship.o2r" ) +find_program(CURL NAMES curl DOC "Path to the curl program. Used to download files.") +execute_process(COMMAND ${CURL} -sSfL https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt -o ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt OUTPUT_VARIABLE RESULT) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") install(FILES "${CMAKE_BINARY_DIR}/ghostship.o2r" DESTINATION . COMPONENT ${PROJECT_NAME}) install(DIRECTORY "${CMAKE_SOURCE_DIR}/assets/" DESTINATION ./assets COMPONENT ${PROJECT_NAME}) @@ -673,6 +676,10 @@ add_custom_target(CreateOSXIcons add_dependencies(${PROJECT_NAME} CreateOSXIcons) configure_file("${CMAKE_SOURCE_DIR}/Info.plist" "${CMAKE_BINARY_DIR}/Info.plist" COPYONLY) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ../MacOS COMPONENT Ghostship) +INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT Ghostship) +INSTALL(FILES ${CMAKE_BINARY_DIR}/ghostship.o2r DESTINATION ../Resources COMPONENT Ghostship) +INSTALL(FILES ${CMAKE_BINARY_DIR}/config.yml DESTINATION ../Resources COMPONENT Ghostship) +INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/assets/ DESTINATION ../Resources/assets COMPONENT Ghostship) # Rename the installed soh binary to drop the macos suffix # INSTALL(CODE "FILE(RENAME \${CMAKE_INSTALL_PREFIX}/../MacOS/Ghostship-macos \${CMAKE_INSTALL_PREFIX}/../MacOS/Ghostship)") # install(CODE "