CI: cache build artifacts and configs
Some checks failed
Build and publish wylab SS14 server / build-and-push-image (push) Has been cancelled

This commit is contained in:
Codex Agent
2025-12-14 23:33:08 +01:00
parent 59c193f954
commit 8633363c22
4 changed files with 47 additions and 16 deletions

View File

@@ -16,10 +16,12 @@ env:
TARGET_PLATFORM: linux-x64
WYLAB_SOURCE_REPO: https://git.wylab.me/wylab/wylab-station-14.git
WYLAB_SOURCE_REF: master
BUILD_CACHE_SCOPE: ws14-docker-linux-server
jobs:
build-and-push-image:
runs-on: ubuntu-latest
timeout-minutes: 240
permissions:
contents: read
packages: write
@@ -65,6 +67,10 @@ jobs:
with:
context: .
platforms: linux/amd64
cache-from: |
type=gha,scope=${{ env.BUILD_CACHE_SCOPE }}
cache-to: |
type=gha,scope=${{ env.BUILD_CACHE_SCOPE }},mode=max,compression=zstd
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

View File

@@ -1,3 +1,6 @@
#
# syntax=docker/dockerfile:1.7
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
@@ -6,9 +9,10 @@ ARG SOURCE_REF=master
ARG TARGET_PLATFORM=linux-x64
# Install dependencies needed to build and package the server
RUN apt-get update && \
apt-get install -y --no-install-recommends git python3 unzip && \
rm -rf /var/lib/apt/lists/*
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt/lists \
apt-get update && \
apt-get install -y --no-install-recommends git python3 unzip
WORKDIR /src
@@ -21,9 +25,10 @@ RUN git checkout "${SOURCE_REF}"
RUN python3 RUN_THIS.py --quiet
# Build and package the server for the requested platform
RUN dotnet run --project Content.Packaging/Content.Packaging.csproj server \
--platform "${TARGET_PLATFORM}" \
--configuration Release
RUN --mount=type=cache,target=/root/.nuget/packages \
dotnet run --project Content.Packaging/Content.Packaging.csproj server \
--platform "${TARGET_PLATFORM}" \
--configuration Release
# Extract packaged build into the filesystem layout the runtime stage expects
RUN mkdir -p /ss14-default && \
@@ -32,8 +37,13 @@ RUN mkdir -p /ss14-default && \
# Server stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS server
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates python3 && \
rm -rf /var/lib/apt/lists/*
# Copy from the build stage
COPY --from=build /ss14-default /ss14-default
COPY update_build_metadata.py /update_build_metadata.py
# Expose necessary ports
EXPOSE 1212/tcp
@@ -48,7 +58,8 @@ ADD appsettings.yml /ss14-default/publish/appsettings.yml
ADD server_config.toml /ss14-default/publish/server_config.toml
COPY start.sh /start.sh
RUN chmod +x /start.sh
RUN python3 /update_build_metadata.py /ss14-default/publish/server_config.toml || true && \
chmod +x /start.sh
# Set the entry point for the container
ENTRYPOINT ["/start.sh"]

View File

@@ -41,6 +41,17 @@ baseUrl = "http://localhost:8080/"
[game]
hostname = "MyServer"
lobbyenabled = true
# Lobby wait in seconds before round start (default 150s)
lobbyduration = 180
defaultpreset = "secret"
fallbackpreset = "Traitor,Extended"
fallbackenabled = true
# Use built-in rotation list; edit this when you add custom pools.
map_pool = "DefaultMapPool"
map_rotation = true
# How many past rounds are remembered when picking the next map.
map_memory_depth = 8
[console]
# If this is true, people connecting from this machine (loopback)
@@ -80,20 +91,16 @@ hub_urls = "https://central.spacestation14.io/hub/"
# version = "Example1"
# This is where the launcher will download the client ZIP from.
# If this isn't supplied, the server will check for a file called "Content.Client.zip",
# and will host it on the status server.
# If that isn't available, the server will attempt to find and use "../../Resources" and
# "../../bin/Content.Client" to automatically construct a client zip.
# It will then host this on the status server.
# Note that these paths do not work on "FULL_RELEASE" servers.
# FULL_RELEASE servers expect to be used with a specific "packaged" layout.
# As such, whatever script you're using to package them is expected to create the ZIP.
# download_url = "http://example.com/compass.zip"
# If you run Robust.Cdn, point this at the CDN endpoint that serves the latest client build.
# If it isn't supplied, the server tries to host Content.Client.zip itself.
# download_url = "https://cdn.example.com/ss14/client/latest.zip"
download_url = "https://cdn.wylab.me/fork/wylab/version/bce50cad4cebdc8443947911be72c8c0ffbad713/file/SS14.Client.zip"
# Build hash - this is a *capitalized* SHA256 hash of the client ZIP.
# Optional in any case and automatically set if hosting a client ZIP.
# This hash is an example only.
# build = "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855"
build = "D51F7777997E329D9B5A8B307AB8F49FF0A699D1B52EC7B7505C3DBBFF92E103"
[auth]
# Authentication (accounts):

View File

@@ -25,5 +25,12 @@ fi
SERVER_DIR=$(dirname "$SERVER_PATH")
cd "$SERVER_DIR" || exit 1
# Auto-sync build.download_url and build hash from Robust.Cdn manifest.
CONFIG_PATH="$SERVER_DIR/server_config.toml"
if command -v python3 >/dev/null && [ -f "$CONFIG_PATH" ] && [ -f /update_build_metadata.py ]; then
python3 /update_build_metadata.py "$CONFIG_PATH" || echo "[WARN] Unable to update build metadata"
fi
chmod +x "$SERVER_PATH"
exec "$SERVER_PATH" "$@"