using containers
This commit is contained in:
39
.github/docker/Dockerfile.alpine
vendored
Normal file
39
.github/docker/Dockerfile.alpine
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Dockerfile.alpine
|
||||||
|
FROM alpine:edge
|
||||||
|
|
||||||
|
# Enable the edge and edge/community repositories.
|
||||||
|
# If you already have those in your base image, you might not need these echo lines.
|
||||||
|
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
|
||||||
|
echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
|
||||||
|
|
||||||
|
# Update indexes and install packages
|
||||||
|
RUN apk update && \
|
||||||
|
apk add --no-cache \
|
||||||
|
# Basic dev tools
|
||||||
|
build-base \
|
||||||
|
binutils \
|
||||||
|
mold \
|
||||||
|
meson \
|
||||||
|
cmake \
|
||||||
|
ninja \
|
||||||
|
git \
|
||||||
|
pkgconf \
|
||||||
|
ccache \
|
||||||
|
# Node.js + npm
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
|
# Misc
|
||||||
|
zip \
|
||||||
|
# Audio/Video dev libs
|
||||||
|
alsa-lib-dev \
|
||||||
|
pulseaudio-dev \
|
||||||
|
libudev-zero-dev \
|
||||||
|
# Wayland dev libs
|
||||||
|
wayland-dev \
|
||||||
|
wayland-protocols \
|
||||||
|
mesa-dev \
|
||||||
|
# Finally, the new SDL3 dev package on Alpine edge
|
||||||
|
sdl3
|
||||||
|
|
||||||
|
# (Optional) If you want a default working directory:
|
||||||
|
WORKDIR /workspace
|
||||||
31
.github/docker/Dockerfile.linux
vendored
Normal file
31
.github/docker/Dockerfile.linux
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Dockerfile.linux
|
||||||
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libasound2-dev \
|
||||||
|
libpulse-dev \
|
||||||
|
libudev-dev \
|
||||||
|
libwayland-dev \
|
||||||
|
wayland-protocols \
|
||||||
|
libxkbcommon-dev \
|
||||||
|
libx11-dev \
|
||||||
|
libxext-dev \
|
||||||
|
libxrandr-dev \
|
||||||
|
libxcursor-dev \
|
||||||
|
libxi-dev \
|
||||||
|
libxinerama-dev \
|
||||||
|
libxss-dev \
|
||||||
|
libegl1-mesa-dev \
|
||||||
|
libgl1-mesa-dev \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
git \
|
||||||
|
build-essential \
|
||||||
|
binutils \
|
||||||
|
mold \
|
||||||
|
meson \
|
||||||
|
pkg-config \
|
||||||
|
npm nodejs zip \
|
||||||
|
ccache && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
17
.github/docker/Dockerfile.mingw
vendored
Normal file
17
.github/docker/Dockerfile.mingw
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Dockerfile.windows-cross
|
||||||
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
mingw-w64 \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
git \
|
||||||
|
build-essential \
|
||||||
|
binutils \
|
||||||
|
pkg-config \
|
||||||
|
meson \
|
||||||
|
zip \
|
||||||
|
npm nodejs \
|
||||||
|
ccache && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
93
.github/workflows/build.yml
vendored
93
.github/workflows/build.yml
vendored
@@ -2,54 +2,35 @@ name: Build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "*" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
# Pull and run inside your prebuilt Docker image for Linux
|
||||||
|
image: gitea.pockle.world/john/prosperon/linux:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y \
|
|
||||||
libasound2-dev libpulse-dev libudev-dev \
|
|
||||||
libwayland-dev wayland-protocols libxkbcommon-dev \
|
|
||||||
libx11-dev libxext-dev libxrandr-dev libxcursor-dev \
|
|
||||||
libxi-dev libxinerama-dev libxss-dev \
|
|
||||||
libegl1-mesa-dev libgl1-mesa-dev \
|
|
||||||
cmake ninja-build git build-essential binutils mold meson pkg-config \
|
|
||||||
ccache
|
|
||||||
|
|
||||||
- name: Configure ccache
|
|
||||||
run: |
|
|
||||||
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
||||||
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Cache ccache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.ccache
|
|
||||||
key: ccache-linux-${{ hashFiles('**/*.c', '**/*.cpp', '**/*.h', '**/CMakeLists.txt', '**/meson.build') }}
|
|
||||||
restore-keys: |
|
|
||||||
ccache-linux-
|
|
||||||
|
|
||||||
- name: Cache SDL3 (Linux)
|
- name: Cache SDL3 (Linux)
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
sdl3
|
sdl3
|
||||||
sdl3-build
|
sdl3-build
|
||||||
key: sdl3-linux-${{ hashFiles('sdl3/CMakeLists.txt') }}
|
key: sdl3-linux-${{ hashFiles('sdl3/CMakeLists.txt') }}
|
||||||
|
|
||||||
- name: Build SDL3 (Linux)
|
- name: Build SDL3 (Linux)
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d "sdl3/.git" ]; then
|
if [ ! -d "sdl3/.git" ]; then
|
||||||
echo "Cloning SDL3 repository..."
|
echo "Cloning SDL3 repository..."
|
||||||
git clone --depth 1 --branch release-3.2.4 https://github.com/libsdl-org/SDL.git sdl3
|
git clone --depth 1 --branch main https://github.com/libsdl-org/SDL.git sdl3
|
||||||
else
|
else
|
||||||
echo "SDL3 source is already present (possibly from cache)."
|
echo "SDL3 source is already present (possibly from cache)."
|
||||||
fi
|
fi
|
||||||
@@ -62,12 +43,12 @@ jobs:
|
|||||||
-DSDL_SHARED=ON \
|
-DSDL_SHARED=ON \
|
||||||
-DSDL_STATIC=OFF
|
-DSDL_STATIC=OFF
|
||||||
ninja
|
ninja
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
- name: Build Prosperon (Linux)
|
- name: Build Prosperon (Linux)
|
||||||
run: |
|
run: |
|
||||||
export PKG_CONFIG_PATH="${PWD}/sdl3-build/installed_sdl3/lib/pkgconfig:$PKG_CONFIG_PATH"
|
export PKG_CONFIG_PATH="${PWD}/sdl3-build/installed_sdl3/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
meson setup build_dbg -Dbuildtype=release -Db_lto=true -Db_ndebug=true
|
meson setup build_dbg -Dbuildtype=debugoptimized
|
||||||
meson compile -C build_dbg
|
meson compile -C build_dbg
|
||||||
|
|
||||||
- name: Create artifact folder (Linux)
|
- name: Create artifact folder (Linux)
|
||||||
@@ -75,9 +56,10 @@ jobs:
|
|||||||
mkdir _pack
|
mkdir _pack
|
||||||
cp build_dbg/prosperon _pack/
|
cp build_dbg/prosperon _pack/
|
||||||
# Adjust wildcard if there's a versioned libSDL3. e.g. libSDL3-0.600.0.so
|
# Adjust wildcard if there's a versioned libSDL3. e.g. libSDL3-0.600.0.so
|
||||||
cp sdl3-build/installed_sdl3/lib/libSDL3.so _pack/
|
cp sdl3-build/installed_sdl3/lib/libSDL3.so _pack/
|
||||||
|
|
||||||
- name: Upload Artifact (Linux)
|
- name: Upload Artifact (Linux)
|
||||||
|
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: prosperon-artifacts-linux
|
name: prosperon-artifacts-linux
|
||||||
@@ -85,43 +67,27 @@ jobs:
|
|||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
# Pull and run inside your prebuilt Docker image for Windows cross-compilation
|
||||||
|
image: gitea.pockle.world/john/prosperon/mingw:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check Out Code
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Dependencies (Windows Cross)
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y \
|
|
||||||
mingw-w64 cmake ninja-build git build-essential \
|
|
||||||
binutils pkg-config meson ccache
|
|
||||||
|
|
||||||
- name: Configure ccache
|
|
||||||
run: |
|
|
||||||
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
||||||
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Cache ccache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.ccache
|
|
||||||
key: ccache-win-${{ hashFiles('**/*.c', '**/*.cpp', '**/*.h', '**/CMakeLists.txt', '**/meson.build') }}
|
|
||||||
restore-keys: |
|
|
||||||
ccache-win-
|
|
||||||
|
|
||||||
- name: Cache SDL3 (Windows cross)
|
- name: Cache SDL3 (Windows cross)
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
sdl3-win
|
sdl3-win
|
||||||
sdl3-build-win
|
sdl3-build-win
|
||||||
key: sdl3-win-${{ hashFiles('sdl3-win/CMakeLists.txt') }}
|
key: sdl3-win-${{ hashFiles('sdl3-win/CMakeLists.txt') }}
|
||||||
|
|
||||||
- name: Build SDL3 (Windows cross)
|
- name: Build SDL3 (Windows cross)
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d "sdl3-win/.git" ]; then
|
if [ ! -d "sdl3-win/.git" ]; then
|
||||||
echo "Cloning SDL3 for Windows cross..."
|
echo "Cloning SDL3 for Windows cross..."
|
||||||
git clone --depth 1 --branch release-3.2.4 https://github.com/libsdl-org/SDL.git sdl3-win
|
git clone --depth 1 --branch main https://github.com/libsdl-org/SDL.git sdl3-win
|
||||||
else
|
else
|
||||||
echo "SDL3-win source already present (possibly from cache)."
|
echo "SDL3-win source already present (possibly from cache)."
|
||||||
fi
|
fi
|
||||||
@@ -139,36 +105,37 @@ jobs:
|
|||||||
-DSDL_STATIC=OFF
|
-DSDL_STATIC=OFF
|
||||||
ninja
|
ninja
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
- name: Configure PKG_CONFIG_PATH (Windows cross)
|
- name: Configure PKG_CONFIG_PATH (Windows cross)
|
||||||
run: |
|
run: |
|
||||||
echo "PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/sdl3-build-win/installed_sdl3_win/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
|
echo "PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/sdl3-build-win/installed_sdl3_win/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build Prosperon (Windows cross)
|
- name: Build Prosperon (Windows cross)
|
||||||
run: |
|
run: |
|
||||||
meson setup -Dbuildtype=release -Db_lto=true -Db_ndebug=true --cross-file mingw32.cross build_win
|
meson setup -Dbuildtype=debugoptimized --cross-file mingw32.cross build_win
|
||||||
meson compile -C build_win
|
meson compile -C build_win
|
||||||
|
|
||||||
- name: Create package folder
|
- name: Create package folder
|
||||||
run: |
|
run: |
|
||||||
mkdir _pack
|
mkdir _pack
|
||||||
cp build_win/prosperon.exe _pack/
|
cp build_win/prosperon.exe _pack/
|
||||||
cp sdl3-build-win/installed_sdl3_win/bin/SDL3.dll _pack/
|
cp sdl3-build-win/installed_sdl3_win/bin/SDL3.dll _pack/
|
||||||
|
|
||||||
- name: Upload Artifact (Windows cross)
|
- name: Upload Artifact (Windows cross)
|
||||||
|
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: prosperon-artifacts-windows
|
name: prosperon-artifacts-windows
|
||||||
path: _pack
|
path: _pack
|
||||||
|
|
||||||
|
|
||||||
package-dist:
|
package-dist:
|
||||||
|
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
||||||
needs: [build-linux, build-windows]
|
needs: [build-linux, build-windows]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check Out Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Download Linux Artifacts
|
- name: Download Linux Artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -193,14 +160,12 @@ jobs:
|
|||||||
mkdir dist/linux
|
mkdir dist/linux
|
||||||
mkdir dist/win
|
mkdir dist/win
|
||||||
|
|
||||||
# -------------------
|
|
||||||
# Copy artifacts in
|
# Copy artifacts in
|
||||||
# -------------------
|
|
||||||
cp linux_artifacts/* dist/linux/
|
cp linux_artifacts/* dist/linux/
|
||||||
cp windows_artifacts/* dist/win/
|
cp windows_artifacts/* dist/win/
|
||||||
|
|
||||||
- name: Upload Final Dist
|
- name: Upload Final Dist
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: prosperon
|
name: prosperon
|
||||||
path: dist
|
path: dist
|
||||||
|
|||||||
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Example #1: Build Linux, run tests, but don't package
|
|
||||||
build-test-linux:
|
|
||||||
uses: ./.github/workflows/build.yml
|
|
||||||
with:
|
|
||||||
platform: linux
|
|
||||||
run-tests: false
|
|
||||||
package-dist: false
|
|
||||||
|
|
||||||
# Example #2: Build Windows, no tests, but package artifacts
|
|
||||||
build-package-windows:
|
|
||||||
uses: ./.github/workflows/build.yml
|
|
||||||
with:
|
|
||||||
platform: windows
|
|
||||||
run-tests: false
|
|
||||||
package-dist: false
|
|
||||||
|
|
||||||
# You can add more calls here for different combos of
|
|
||||||
# (run-tests, package-dist), or do matrix expansions, etc.
|
|
||||||
Reference in New Issue
Block a user