Hopefully improve random #264
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CMake on multiple platforms | |
| on: | |
| push: | |
| paths: | |
| - 'src/**' | |
| - 'CMakeLists.txt' | |
| - 'assets/**' | |
| - 'dependencies/**' | |
| - '.github/workflows/**' | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build-windows: | |
| name: Build for Windows | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x64, ARM64] | |
| target: [Windows] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Configure | |
| run: cmake -DCMAKE_SYSTEM_NAME=${{ matrix.target }} -DCMAKE_SYSTEM_VERSION="10.0" -A${{ matrix.arch }} -S . -B build | |
| - name: Build | |
| run: cmake --build build --target 8ChocChip --config Release | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ matrix.target != 'WindowsStore' }} | |
| with: | |
| name: 8ChocChip-${{ matrix.target }}-${{ matrix.arch }} | |
| path: | | |
| build/Release/*.exe | |
| build/Release/*.dll | |
| build/Release/assets/ | |
| build-linux: | |
| name: Build for Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y --no-install-recommends build-essential git cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev libxtst-dev | |
| - name: Configure | |
| run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -S . -B build | |
| - name: Build | |
| run: cmake --build build --target 8ChocChip --config Release | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 8ChocChip-Linux | |
| path: | | |
| build/Release/8ChocChip | |
| build/Release/*.so | |
| build/Release/assets/ | |
| # build-mac: | |
| # name: Build for Apple | |
| # runs-on: macos-14 | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # target: [''] | |
| # | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # submodules: recursive | |
| # - name: Setup Xcode version | |
| # uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| # with: | |
| # xcode-version: "16.1" | |
| # - name: Configure | |
| # run: cmake -G "Xcode" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO -DCMAKE_SYSTEM_NAME=${{ matrix.target }} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -S . -B build | |
| # - name: Build | |
| # run: cmake --build build --target install --config Release | |
| # - name: Ad-Hoc Codesign | |
| # run: codesign -s - -f "./build/release/sdl-min.app" --deep | |
| # - name: Create DMG | |
| # run: | | |
| # cd build | |
| # hdiutil create -size 2g -srcfolder release -volname 8ChocChip_apple_${{ matrix.target }} 8ChocChip_apple_${{ matrix.target }}.dmg | |
| # - name: Upload Build | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: 8ChocChip-apple-${{ matrix.target }} | |
| # path: build/*.dmg |