Build #21
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: Build | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Only on version tags like v0.0.3 | |
| workflow_dispatch: # Manual trigger from GitHub UI | |
| inputs: | |
| platform: | |
| description: 'Platform to build' | |
| required: true | |
| default: 'all' | |
| type: choice | |
| options: | |
| - all | |
| - linux | |
| - macos | |
| - windows | |
| jobs: | |
| build-linux: | |
| if: ${{ github.event_name == 'push' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential cmake pkg-config \ | |
| autoconf automake libtool \ | |
| libgl1-mesa-dev libglu1-mesa-dev \ | |
| libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \ | |
| libwayland-dev libxkbcommon-dev wayland-protocols \ | |
| libasound2-dev \ | |
| libportaudio2 portaudio19-dev \ | |
| libsndfile1-dev \ | |
| libfreetype6-dev | |
| - name: Build prerequisites (glyphy, etc.) | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DBuildPrerequisites=ON | |
| make -j$(nproc) | |
| - name: Build goban | |
| run: | | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DBuildPrerequisites=OFF | |
| make -j$(nproc) | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: goban-linux-x64 | |
| path: build/goban | |
| build-macos: | |
| if: ${{ github.event_name == 'push' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos' }} | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| brew install autoconf automake libtool | |
| brew install portaudio libsndfile | |
| - name: Build prerequisites (glyphy, etc.) | |
| run: | | |
| mkdir -p build | |
| cd build | |
| # Note: macOS doesn't need X11/ALSA - GLFW uses Cocoa, PortAudio uses CoreAudio | |
| # This may require CMakeLists.txt fixes for macOS | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DBuildPrerequisites=ON || true | |
| make -j$(sysctl -n hw.ncpu) || true | |
| - name: Build goban | |
| run: | | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DBuildPrerequisites=OFF | |
| make -j$(sysctl -n hw.ncpu) | |
| - name: Upload artifact | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: goban-macos-x64 | |
| path: build/goban | |
| build-windows: | |
| if: ${{ github.event_name == 'push' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'windows' }} | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup MSVC | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Install dependencies via vcpkg | |
| run: vcpkg install freetype portaudio libsndfile --triplet x64-windows-static | |
| - name: Build prerequisites | |
| shell: cmd | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DBuildPrerequisites=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static | |
| cmake --build . --config Release --verbose | |
| - name: Build goban | |
| shell: cmd | |
| run: | | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=Release -DBuildPrerequisites=OFF -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static | |
| cmake --build . --config Release | |
| - name: Upload artifact | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: goban-windows-x64 | |
| path: build/Release/goban.exe |