CI: Add Docker build

Signed-off-by: Thomas Rohloff <v10lator@myway.de>
This commit is contained in:
Thomas Rohloff
2025-06-24 11:59:08 +02:00
parent 9e1543d434
commit 39b7b7d319
4 changed files with 96 additions and 2 deletions
+25
View File
@@ -296,6 +296,31 @@ jobs:
yamls
gamecontrollerdb.txt
build-linux-docker:
needs: generate-port-o2r
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Build docker image
if: steps.cache.outputs.cache-hit != 'true'
run: docker build . -t spaghetti
- name: Build AppImage
run: docker run --rm -v ${PWD}:/project spaghetti ./build.sh
- name: Prepare Artifact
run: |
wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
mv README.md readme.txt
cp build-cmake/*.appimage spaghetti.appimage
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: Spaghettify-linux
path: |
spaghetti.appimage
config.yml
yamls
gamecontrollerdb.txt
build-switch:
needs: generate-port-o2r
runs-on: ubuntu-latest
+1 -2
View File
@@ -110,7 +110,6 @@ mingw64/
# torch
torch.hash.yml
build*
.idea
# the game
@@ -125,4 +124,4 @@ cmake-build-*/
.idea/
.vs
build*/
.DS_Store
.DS_Store
+53
View File
@@ -0,0 +1,53 @@
FROM ubuntu:latest
# Install dependencies
RUN apt-get update -y && apt-get -y upgrade && apt-get -y install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libsdl2-net-dev libpng-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev wget file
# Install latest SDL
RUN wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz && \
tar -xzf SDL2-2.30.3.tar.gz && \
cd SDL2-2.30.3 && \
./configure --enable-hidapi-libusb && \
make -j$(nproc) && \
make install && \
cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ && \
cd .. && \
rm -rf SDL2-2.30.3.tar.gz SDL2-2.30.3
# Install latest SDL_net
RUN wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz && \
tar -xzf SDL2_net-2.2.0.tar.gz && \
cd SDL2_net-2.2.0 && \
./configure && \
make -j$(nproc) && \
make install && \
cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/ && \
cd .. && \
rm -rf SDL2_net-2.2.0.tar.gz SDL2_net-2.2.0
# Install latest tinyxml2
RUN wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz && \
tar -xzf 10.0.0.tar.gz && \
cd tinyxml2-10.0.0 && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf 10.0.0.tar.gz tinyxml2-10.0.0
# Install libzip without crypto
RUN wget https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.gz && \
tar -xzf libzip-1.10.1.tar.gz && \
cd libzip-1.10.1 && \
mkdir -p build && \
cd build && \
cmake .. -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF && \
make -j$(nproc) && \
make install & \
# cp -av /usr/local/lib/libzip* /lib/x86_64-linux-gnu/ && \
cd ../.. && \
rm -rf libzip-1.10.1.tar.gz libzip-1.10.1
WORKDIR /project
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# Init git submodules
git config --global --add safe.directory /project
git submodule update --init
# Build spaghetti.o2r
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release
cmake --build build-cmake --target GenerateO2R -j$(nproc)
# Build spaghetti executable
cmake --build build-cmake --config Release -j$(nproc)
# Pack AppImage
cd build-cmake
cpack -G External
cd ..