-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.42 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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