fix: test if assets are there

This commit is contained in:
theoleuthardt 2025-03-13 11:58:06 +01:00
parent 346eba766b
commit cac123bb58

View file

@ -38,39 +38,23 @@ jobs:
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
shell: powershell shell: powershell
- name: List Current Directory
run: ls -la
shell: bash
- name: Configure CMake - 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: | run: |
mkdir -p build/macos if [ -d "assets" ]; then
cp -r assets build/macos/ echo "Assets directory exists"
shell: bash else
echo "Assets directory does not exist"
- name: Copy Assets (Linux) mkdir -p assets
if: runner.os == 'Linux' fi
run: | cmake -B build
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 shell: bash
- name: Build Project - name: Build Project
run: | run: cmake --build build --config Release
if [ "${{ runner.os }}" == "macOS" ]; then
cmake --build build --config Release --target DinoGame
else
cmake --build build --config Release
fi
shell: bash shell: bash
- name: Determine Output Directory - name: Determine Output Directory
@ -85,6 +69,21 @@ jobs:
fi fi
shell: bash shell: bash
- name: Fix Assets (if necessary)
run: |
TARGET_DIR="${{ steps.get-output-dir.outputs.output_dir }}/assets"
if [ ! -d "$TARGET_DIR" ]; then
echo "Creating assets directory in output directory"
mkdir -p "$TARGET_DIR"
# Wenn das ursprüngliche assets-Verzeichnis existiert, kopiere seinen Inhalt
if [ -d "assets" ]; then
cp -r assets/* "$TARGET_DIR"/ || echo "Note: No assets to copy or copy failed"
else
echo "No source assets directory found, creating empty directory"
fi
fi
shell: bash
- name: Zip Build with Assets (Linux/macOS) - name: Zip Build with Assets (Linux/macOS)
if: runner.os != 'Windows' if: runner.os != 'Windows'
run: | run: |