release builds #34
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: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libsdl2-dev mingw-w64 | |
- name: Build for Linux | |
run: | | |
gcc -o Chip8Interpreter src/*.c -lSDL2 -lm | |
- name: Setup SDL2 for Windows | |
run: | | |
wget https://www.libsdl.org/release/SDL2-devel-2.0.14-VC.zip | |
unzip SDL2-devel-2.0.14-VC.zip | |
- name: List contents of SDL2 directory | |
run: ls -la SDL2-2.0.14/lib | |
- name: Build for Windows | |
run: | | |
x86_64-w64-mingw32-gcc -o Chip8Interpreter.exe src/*.c -I SDL2-2.0.14/include -L SDL2-2.0.14/lib/x86_64-w64-mingw32 -lmingw32 -lSDL2main -lSDL2 -lm | |
- name: Setup osxcross | |
run: | | |
sudo apt-get install -y clang cmake git lzma-dev libxml2-dev libssl-dev zlib1g-dev | |
git clone https://github.com/tpoechtrager/osxcross | |
cd osxcross | |
wget -P tarballs https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.11.sdk.tar.xz | |
UNATTENDED=yes OSX_VERSION_MIN=10.6 ./build.sh | |
- name: Build for macOS | |
run: | | |
PATH=$PATH:$(pwd)/osxcross/target/bin | |
o64-clang -o Chip8Interpreter src/*.c -lSDL2 -lm | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Chip8Interpreter-Linux | |
path: ./Chip8Interpreter | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Chip8Interpreter-Windows | |
path: ./Chip8Interpreter.exe | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Chip8Interpreter-macOS | |
path: ./Chip8Interpreter |