release builds #29
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: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
if [[ "${{ runner.os }}" == "Windows" ]]; then | |
choco install mingw | |
curl -L -o SDL2.zip https://www.libsdl.org/release/SDL2-devel-2.0.14-VC.zip | |
7z x SDL2.zip -o. | |
mv SDL2-2.0.14 C:/SDL2 | |
elif [[ "${{ runner.os }}" == "Linux" ]]; then | |
sudo apt-get update | |
sudo apt-get install -y libsdl2-dev | |
elif [[ "${{ runner.os }}" == "macOS" ]]; then | |
brew install sdl2 | |
fi | |
shell: bash | |
- name: Build | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
gcc -o Chip8Interpreter src/*.c -IC:/SDL2/SDL2-2.0.14/include -LC:/SDL2/SDL2-2.0.14/lib/x64 -lmingw32 -lSDL2main -lSDL2 -lm | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
gcc -o Chip8Interpreter src/*.c -I/usr/local/include/SDL2 -lSDL2 -lm | |
else | |
gcc -o Chip8Interpreter src/*.c -lSDL2 -lm | |
fi | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Chip8Interpreter-${{ matrix.os }} | |
path: ./Chip8Interpreter |