Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jorio committed Feb 7, 2023
1 parent 30c2d82 commit 8ecd22f
Show file tree
Hide file tree
Showing 8 changed files with 410 additions and 17 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage --no-appstream build/CandyCrisis.AppDir build/CandyCrisis.AppImage
./appimagetool-x86_64.AppImage --no-appstream build/CandyCrisis.AppDir build/CandyCrisis-linux-x86_64.AppImage
- name: Upload
uses: actions/upload-artifact@v3
with:
name: linux-build
path: build/CandyCrisis.AppImage
name: CandyCrisis-linux-x86_64.AppImage
path: build/CandyCrisis-linux-x86_64.AppImage

build-windows:
runs-on: windows-2022
Expand All @@ -68,14 +68,15 @@ jobs:
- name: Copy vcredist
run: |
cmake --install build --prefix build/install
copy build/ReadMe.txt build/Release
copy build/install/bin/msvcp140.dll build/Release
copy build/install/bin/vcruntime140.dll build/Release
copy build/install/bin/vcruntime140_1.dll build/Release
- name: Upload
uses: actions/upload-artifact@v3
with:
name: windows-build
name: CandyCrisis-windows-x64
path: build/Release

build-macos:
Expand Down Expand Up @@ -107,21 +108,23 @@ jobs:
run: cmake --build build --config RelWithDebInfo -- -j ${{ env.NPROC }}

- name: Codesign
run: codesign --force --sign ${{ secrets.APPLE_DEVELOPMENT_TEAM }} --options runtime build/RelWithDebInfo/CandyCrisis.app
run: codesign --force --sign ${{ secrets.APPLE_DEVELOPMENT_TEAM }} --options runtime "build/RelWithDebInfo/Candy Crisis.app"

- name: Create dmg
run: hdiutil create -fs HFS+ -srcfolder build/RelWithDebInfo -volname "Candy Crisis" build/game.dmg
run: |
cp build/ReadMe.txt build/RelWithDebInfo
hdiutil create -fs HFS+ -srcfolder build/RelWithDebInfo -volname "Candy Crisis" build/CandyCrisis-mac.dmg
- name: Notarize
run: |
xcrun notarytool store-credentials MyNotarizationProfileName --apple-id ${{ secrets.APPLE_NOTARIZATION_USERNAME }} --password ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} --team-id ${{ secrets.APPLE_DEVELOPMENT_TEAM }}
xcrun notarytool submit build/game.dmg --keychain-profile MyNotarizationProfileName --wait
xcrun notarytool submit build/CandyCrisis-mac.dmg --keychain-profile MyNotarizationProfileName --wait
- name: Staple
run: xcrun stapler staple build/game.dmg
run: xcrun stapler staple build/CandyCrisis-mac.dmg

- name: Upload
uses: actions/upload-artifact@v3
with:
name: mac-build
path: build/game.dmg
name: CandyCrisis-mac.dmg
path: build/CandyCrisis-mac.dmg
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.16) # Oldest supported Ubuntu is 20.04, which ships with cmake 3.16

set(GAME_TARGET "CandyCrisis")
set(GAME_MAC_BUNDLE_ID "io.jor.candycrisis")
Expand Down Expand Up @@ -58,29 +58,30 @@ file(GLOB_RECURSE GAME_SOURCES CONFIGURE_DEPENDS ${GAME_SOURCE_DIR}/*.cpp ${GAME

if(WIN32)
list(APPEND GAME_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/app.exe.rc)

add_executable(${GAME_TARGET} WIN32 MACOSX_BUNDLE ${GAME_SOURCES})
elseif(APPLE)
list(APPEND GAME_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/app.icns)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/packaging/app.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

add_executable(${GAME_TARGET} MACOSX_BUNDLE ${GAME_SOURCES})
else()
# Math lib, explicitly required on some Linux systems
#list(APPEND GAME_LIBRARIES m)

add_executable(${GAME_TARGET} ${GAME_SOURCES})
endif()

add_executable(${GAME_TARGET} ${GAME_SOURCES})

target_include_directories(${GAME_TARGET} PRIVATE ${GAME_SOURCE_DIR})


if (APPLE)
set_target_properties(${GAME_TARGET} PROPERTIES
OUTPUT_NAME "Candy Crisis")
endif()

set_target_properties(${GAME_TARGET} PROPERTIES
#--------------------------------------------------------------------------
# MSVC/WIN32
#--------------------------------------------------------------------------

WIN32_EXECUTABLE TRUE # GUI application instead of console application
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
VS_DPI_AWARE "PerMonitor"

Expand All @@ -94,6 +95,9 @@ set_target_properties(${GAME_TARGET} PROPERTIES
# Explicitly turn off code signing, otherwise downloaded app will be quarantined forever
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""

# Build it as an .app bundle
MACOSX_BUNDLE TRUE

# Set up Info.plist values
MACOSX_BUNDLE_ICON_FILE "app.icns" # CFBundleIconFile
MACOSX_BUNDLE_EXECUTABLE_NAME ${GAME_TARGET} # CFBundleExecutable - executable name inside the bundle
Expand Down Expand Up @@ -149,3 +153,6 @@ if(WIN32)
# When installing (cmake --install), copy Visual Studio redistributable DLLs to install location
include(InstallRequiredSystemLibraries)
endif()

# Copy documentation to output folder
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/ReadMe.txt.in ${CMAKE_CURRENT_BINARY_DIR}/ReadMe.txt)
Loading

0 comments on commit 8ecd22f

Please sign in to comment.