diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2beff3f5..eddd3c7b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -7,6 +7,7 @@ permissions: contents: write id-token: write attestations: write + packages: write concurrency: group: nightly @@ -203,6 +204,76 @@ jobs: name: server-build path: staging/* + docker: + name: Build Docker (${{ matrix.variant }}) + needs: build-server + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - variant: vanilla + zip: LCE-Revelations-Server-Win64.zip + subdir: LCE-Revelations-Server-Win64 + image: lce-revelations-dedicated-server + - variant: fourkit + zip: LCE-Revelations-Server-Win64-FourKit.zip + subdir: LCE-Revelations-Server-Win64-FourKit + image: lce-revelations-dedicated-server-fourkit + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Download server artifacts + uses: actions/download-artifact@v7 + with: + name: server-build + path: .artifacts/ + + - name: Prepare runtime directory + shell: bash + run: | + set -euo pipefail + rm -rf runtime .extracted + unzip -q ".artifacts/${{ matrix.zip }}" -d .extracted + mv ".extracted/${{ matrix.subdir }}" runtime + # Strip debug symbols to keep image small (zip includes .pdb). + find runtime -name '*.pdb' -delete + + - name: Compute image name + id: image + shell: bash + run: | + owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" + echo "image=ghcr.io/$owner/${{ matrix.image }}" >> "$GITHUB_OUTPUT" + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ steps.image.outputs.image }} + tags: | + type=raw,value=nightly + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push image + uses: docker/build-push-action@v6 + with: + context: . + file: docker/dedicated-server/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + MC_RUNTIME_DIR=runtime + release-server: name: Release Server needs: build-server @@ -361,7 +432,7 @@ jobs: --notes-file notes.md cleanup: - needs: [release-client, release-server] + needs: [release-client, release-server, docker] if: always() runs-on: ubuntu-latest steps: diff --git a/docker-compose.dedicated-server.yml b/docker-compose.dedicated-server.yml index 50debaf1..15c223d6 100644 --- a/docker-compose.dedicated-server.yml +++ b/docker-compose.dedicated-server.yml @@ -5,9 +5,7 @@ services: dockerfile: docker/dedicated-server/Dockerfile args: # Bakes the vanilla (no plugin support) server flavour built with CMake. - # The FourKit-enabled flavour is intentionally NOT shipped via Docker - # yet because hosting .NET 10 self-contained through Wine has not been - # smoke-tested. Run the FourKit server natively on Windows instead. + # See docker-compose.dedicated-server.fourkit.yml for the FourKit flavour. MC_RUNTIME_DIR: ${MC_RUNTIME_DIR:-build/windows64/Minecraft.Server/Release} container_name: lce-revelations-dedicated-server restart: unless-stopped diff --git a/docker/dedicated-server/Dockerfile b/docker/dedicated-server/Dockerfile index 26ccbce2..eb46c279 100644 --- a/docker/dedicated-server/Dockerfile +++ b/docker/dedicated-server/Dockerfile @@ -2,15 +2,10 @@ FROM debian:bookworm-slim ARG DEBIAN_FRONTEND=noninteractive # Build the server with CMake first (see COMPILE.md). The build context is -# the repo root, and the path below points at the **vanilla** server's Release -# output. The vanilla flavour is shipped because it has no .NET dependency -# and runs reliably under Wine. -# -# A FourKit-enabled image is intentionally NOT built here yet: hosting the -# .NET 10 self-contained runtime through Wine has not been smoke-tested. -# Once it's validated, this Dockerfile can be extended (or split into a -# second variant) to bake in the runtime/ and plugins/ folders from -# build/windows64/Minecraft.Server.FourKit/Release. +# the repo root, and MC_RUNTIME_DIR should point at a Release output that +# contains Minecraft.Server.exe, iggy_w64.dll, Common/, and Windows64/. For +# the FourKit flavour the same directory will also contain runtime/ and +# plugins/; the wildcard COPY below picks them up automatically. ARG MC_RUNTIME_DIR=build/windows64/Minecraft.Server/Release RUN dpkg --add-architecture i386 \ @@ -29,10 +24,7 @@ ENV WINEPREFIX=/var/opt/wineprefix64 WORKDIR /srv/mc -COPY ${MC_RUNTIME_DIR}/Minecraft.Server.exe /srv/mc/Minecraft.Server.exe -COPY ${MC_RUNTIME_DIR}/iggy_w64.dll /srv/mc/iggy_w64.dll -COPY ${MC_RUNTIME_DIR}/Common /srv/mc/Common -COPY ${MC_RUNTIME_DIR}/Windows64 /srv/mc/Windows64 +COPY ${MC_RUNTIME_DIR}/ /srv/mc/ COPY docker/dedicated-server/entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod 0755 /usr/local/bin/entrypoint.sh \