From 346eba766b3fc1decbf61f902510c08b9b89f6ce Mon Sep 17 00:00:00 2001 From: theoleuthardt Date: Thu, 13 Mar 2025 11:55:19 +0100 Subject: [PATCH] fix: assets path now should be there --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++-------- CMakeLists.txt | 5 +++-- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f35a91..3db8110 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,19 +38,39 @@ jobs: Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 shell: powershell - - name: Create Build Directories - run: | - mkdir -p build/windows/assets - mkdir -p build/linux/assets - mkdir -p build/macos/assets - shell: bash - - name: Configure CMake run: cmake -B build shell: bash + # Modifikation hier - manuelles Kopieren der Assets vor dem Build + - name: Copy Assets (macOS) + if: runner.os == 'macOS' + run: | + mkdir -p build/macos + cp -r assets build/macos/ + shell: bash + + - name: Copy Assets (Linux) + if: runner.os == 'Linux' + run: | + mkdir -p build/linux + cp -r assets build/linux/ + shell: bash + + - name: Copy Assets (Windows) + if: runner.os == 'Windows' + run: | + mkdir -p build/windows + cp -r assets build/windows/ + shell: bash + - name: Build Project - run: cmake --build build --config Release + run: | + if [ "${{ runner.os }}" == "macOS" ]; then + cmake --build build --config Release --target DinoGame + else + cmake --build build --config Release + fi shell: bash - name: Determine Output Directory diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cef132..ce27517 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE raylib) target_compile_definitions(${PROJECT_NAME} PRIVATE RAYLIB_STATIC) add_custom_target(copy_assets ALL - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${ASSETS_PATH} ${OUTPUT_DIR}/assets + COMMAND ${CMAKE_COMMAND} -E remove_directory ${OUTPUT_DIR}/assets + COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_DIR}/assets + COMMAND ${CMAKE_COMMAND} -E copy_directory ${ASSETS_PATH} ${OUTPUT_DIR}/assets ) add_dependencies(${PROJECT_NAME} copy_assets)