Merge branch 'gha-build' #216
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" | |
on: | |
push: | |
# Only run on branches | |
branches: | |
- '**' | |
jobs: | |
linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: "Install dependencies" | |
run: | | |
sudo apt update -y | |
sudo apt install -y libsdl2-dev libsdl2-image-dev | |
- name: "Checkout sources" | |
uses: actions/checkout@v3 | |
- name: "Compile" | |
run: | | |
make bin/brogue | |
- name: "Create artifact" | |
run: | | |
make BrogueCE-linux | |
tar -czvf BrogueCE-linux-x86_64.tar.gz BrogueCE-linux | |
- name: "Upload artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-x86_64 | |
path: BrogueCE-linux-x86_64.tar.gz | |
macos: | |
runs-on: macos-11 | |
steps: | |
- name: "Checkout sources" | |
uses: actions/checkout@v3 | |
- name: "Prepare" | |
run: | | |
make macos/sdl2.rb | |
- name: "Cache SDL2" | |
uses: actions/cache@v3 | |
with: | |
path: sdl2-cellar | |
key: sdl2-${{hashFiles('macos/sdl2.rb')}} | |
- name: "Compile and install dependencies" | |
run: | | |
if [ -d sdl2-cellar ]; then | |
cp -r sdl2-cellar $(brew --cellar)/sdl2 | |
brew link sdl2 | |
else | |
brew install --build-from-source ./macos/sdl2.rb | |
cp -r $(brew --cellar)/sdl2 sdl2-cellar | |
fi | |
brew install sdl2_image dylibbundler | |
- name: "Compile" | |
run: | | |
make MAC_APP=YES Brogue.app | |
env: | |
MACOSX_DEPLOYMENT_TARGET: "10.7" | |
- name: "Fix and bundle dylib references" | |
run: | | |
cd Brogue.app/Contents && dylibbundler -cd -b -x MacOS/brogue | |
- name: "Create artifact" | |
run: | | |
make BrogueCE-macos | |
zip -rll BrogueCE-macos-x86_64.zip BrogueCE-macos | |
- name: "Upload artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-x86_64 | |
path: BrogueCE-macos-x86_64.zip | |
windows: | |
runs-on: windows-latest | |
steps: | |
- name: "Checkout sources" | |
uses: actions/checkout@v3 | |
- name: "Install dependencies" | |
run: | | |
.\.github\get-deps-mingw.ps1 | |
- name: "Compile" | |
shell: powershell | |
run: | | |
$env:path = $env:path + ";" + (Join-Path $pwd.Drive.Root "opt/local/x86_64-w64-mingw32/bin") | |
$env:path = $env:path + ';C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64' | |
mingw32-make SYSTEM=WINDOWS CC=gcc bin/brogue.exe | |
- name: "Create artifact" | |
run: | | |
mingw32-make SYSTEM=WINDOWS BrogueCE-windows | |
cp SDL2\x86_64-w64-mingw32\bin\SDL2.dll BrogueCE-windows | |
cp SDL2_image\x86_64-w64-mingw32\bin\zlib1.dll BrogueCE-windows | |
cp SDL2_image\x86_64-w64-mingw32\bin\SDL2_image.dll BrogueCE-windows | |
cp SDL2_image\x86_64-w64-mingw32\bin\libpng16-16.dll BrogueCE-windows | |
7z a BrogueCE-windows-x86_64.zip BrogueCE-windows | |
- name: "Upload artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-x86_64 | |
path: BrogueCE-windows-x86_64.zip |