Add dockerfile for building linux-x86-64 binaries

This commit is contained in:
Maschell 2020-09-05 11:33:54 +02:00
parent 40c0efcb59
commit 7695362c49
5 changed files with 51 additions and 2 deletions

20
.github/workflows/linux-x86-64.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: linux-x86-64 building.
on:
push:
branches:
- master
jobs:
build-binary:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: build binary
run: |
docker build . -f Dockerfile.pc -t sdl2_playground-builder-pc
docker run -it --rm -v ${PWD}:/project sdl2_playground-builder-pc bash -c "cd .. && bash filelist.sh"
docker run -it --rm -v ${PWD}:/project sdl2_playground-builder-pc cmake ..
docker run -it --rm -v ${PWD}:/project sdl2_playground-builder-pc make
- uses: actions/upload-artifact@master
with:
name: linux-x86-64-shared binary
path: "./cmake-build/SDL2_Playground"

View File

@ -14,5 +14,5 @@ jobs:
docker run --rm -v ${PWD}:/project sdl2_playground-builder-pc-win make -f Makefile.pc-win
- uses: actions/upload-artifact@master
with:
name: binary
name: windows-shared binary
path: "*.exe"

12
Dockerfile.pc Normal file
View File

@ -0,0 +1,12 @@
FROM debian:sid-slim
RUN DEBIAN_FRONTEND="noninteractive"
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils ca-certificates && \
apt-get install -y --no-install-recommends build-essential make git && \
apt-get install -y --no-install-recommends cmake && \
apt-get install -y --no-install-recommends libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /project/cmake-build
WORKDIR /project/cmake-build

View File

@ -9,6 +9,23 @@ bash ./filelist.sh
mkdir build && cd build && cmake .. && make
```
Via docker:
```
# Build the docker image
docker build . -f .\Dockerfile.pc -t sdl2_playground-builder-pc
# Build filelist.h
docker run -it --rm -v ${PWD}:/project sdl2_playground-builder-pc bash -c "cd .. && bash filelist.sh"
# Generate the makefile
docker run -it --rm -v ${PWD}:/project sdl2_playground-builder-pc cmake ..
# build!
docker run -it --rm -v ${PWD}:/project sdl2_playground-builder-pc make
# The result will be in ${PWD}/cmake-build
```
## Windows binaries
### Windows with devkitPros version of msys2