Switch to webgpu #86
Workflow file for this run
This file contains 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 SpaceBoom | |
on: | |
pull_request: | |
branches: [master] # Adjust this if your main branch has a different name | |
release: | |
types: [created] | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
output_name: SpaceBoom-linux | |
- os: macos-latest | |
output_name: SpaceBoom-macos-intel | |
arch: x86_64 | |
- os: macos-latest | |
output_name: SpaceBoom-macos-arm | |
arch: arm64 | |
- os: windows-latest | |
output_name: SpaceBoom-windows.exe | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Print status of submodules | |
run: | | |
git submodule update --init --recursive | |
git submodule status | |
- name: Install dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake ninja-build libgl1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libwayland-dev libxkbcommon-dev xorg-dev libglu1-mesa-dev | |
sudo apt-get install libxrandr-dev libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev pkg-config nodejs npm | |
- name: Install dependencies (macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install cmake ninja | |
- name: Install dependencies (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
choco install cmake ninja | |
- name: Configure CMake (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
mkdir build | |
cd build | |
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release .. | |
- name: Configure CMake (Others) | |
if: matrix.os != 'windows-latest' | |
run: | | |
mkdir build | |
cd build | |
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ${{ matrix.os == 'macos-latest' && format('-DCMAKE_OSX_ARCHITECTURES={0}', matrix.arch) || '' }} .. | |
- name: Build | |
run: | | |
cmake --build build --config Release | |
- name: Prepare release package | |
if: github.event_name == 'release' | |
run: | | |
mkdir release | |
cp build/OpenGL/${{ matrix.os == 'windows-latest' && 'Release/' || '' }}SpaceBoom${{ matrix.os == 'windows-latest' && '.exe' || '' }} release/${{ matrix.output_name }} | |
cp -r OpenGL/res release/res | |
- name: Set executable permissions (macOS) | |
if: github.event_name == 'release' && matrix.os != 'windows-latest' | |
run: | | |
chmod +x release/${{ matrix.output_name }} | |
- name: Create release archive (Unix) | |
if: github.event_name == 'release' && matrix.os != 'windows-latest' | |
run: | | |
cd release | |
zip -r ../${{ matrix.output_name }}.zip . | |
- name: Create release archive (Windows) | |
if: github.event_name == 'release' && matrix.os == 'windows-latest' | |
run: | | |
Compress-Archive -Path release\* -DestinationPath ${{ matrix.output_name }}.zip | |
- name: Upload Release Asset | |
if: github.event_name == 'release' | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ matrix.output_name }}.zip | |
asset_name: ${{ matrix.output_name }}.zip | |
tag: ${{ github.ref }} | |
overwrite: true |