Skip to content

build

build #466

Workflow file for this run

name: build
on:
workflow_dispatch:
jobs:
windows-msys:
name: ${{ matrix.btype }} Windows-GCC ${{ matrix.arch }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
cc: [gcc]
btype: [Release]
include:
- arch: x86
msystem: MINGW32
prefix: mingw-w64-i686
- arch: x86_64
msystem: MINGW64
prefix: mingw-w64-x86_64
- btype: Release
rule: install
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
install: ${{ matrix.prefix }}-binutils ${{ matrix.prefix }}-make ${{ matrix.prefix }}-${{ matrix.cc }}
msystem: ${{ matrix.msystem }}
path-type: minimal
release: false
update: false
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip Debug configuration in Release build
run: |
make clean ARCH=${{ matrix.arch }}
make ${{ matrix.rule }} -j 8 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin USE_RENDERER_DLOPEN=0 RENDERER_DEFAULT=opengl
- uses: actions/upload-artifact@v4
if: matrix.cc == 'gcc' && matrix.btype == 'release'
with:
name: windows-mingw-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
ubuntu-x86:
name: ${{ matrix.btype }} Ubuntu ${{ matrix.arch }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
cc: [gcc]
btype: [Release]
include:
- btype: Release
rule: install
- arch: x86
use_sdl: USE_SDL=0
- arch: x86_64
use_sdl: USE_SDL=1
steps:
- name: Install tools
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
sudo apt-get -y install gcc-multilib libcurl4-openssl-dev:i386 mesa-common-dev:i386 libxxf86dga-dev:i386 libxrandr-dev:i386 libxxf86vm-dev:i386 libasound-dev:i386
else
sudo apt-get -qq update
sudo apt-get -y install libcurl4-openssl-dev mesa-common-dev libxxf86dga-dev libxrandr-dev libxxf86vm-dev libasound-dev libsdl2-dev
fi
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip in Release builds
run: |
make ${{ matrix.rule }} -j 8 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin ${{ matrix.use_sdl }} USE_RENDERER_DLOPEN=0 RENDERER_DEFAULT=opengl
- uses: actions/upload-artifact@v4
if: matrix.cc == 'gcc' && matrix.btype == 'release'
with:
name: linux-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
macos-x86:
name: ${{ matrix.btype }} macOS ${{ matrix.arch }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
cc: [clang]
btype: [Release]
include:
- btype: Release
rule: install
steps:
- name: Install tools
run: brew install coreutils sdl2 # pkg-config
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip Debug configuration in Release build
run: |
make ${{ matrix.rule }} -j 8 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin INSTALL=ginstall USE_RENDERER_DLOPEN=0 RENDERER_DEFAULT=opengl STRIP=echo
- uses: actions/upload-artifact@v4
if: matrix.cc == 'clang' && matrix.btype == 'release'
with:
name: macos-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
update-release:
if: ${{ github.event_name == 'release' }}
needs: [windows-msys, ubuntu-x86, macos-x86]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- artifact_dir: linux-x86
artifact_name: sandbox_linux-x86.zip
- artifact_dir: linux-x86_64
artifact_name: sandbox_linux-x86_64.zip
- artifact_dir: windows-mingw-x86
artifact_name: sandbox_windows-x86.zip
- artifact_dir: windows-mingw-x86_64
artifact_name: sandbox_windows-x86_64.zip
- artifact_dir: macos-x86_64
artifact_name: sandbox_macos-x86_64.zip
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Create archive
run: 7z a -r ${{ matrix.artifact_name }} ./${{ matrix.artifact_dir }}/*
- name: Upload archive
uses: "svenstaro/upload-release-action@latest"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
overwrite: true
file: ${{ matrix.artifact_name }}