From 1916037ff8641219149090c5ddfcc6ff53a81438 Mon Sep 17 00:00:00 2001 From: wylab Date: Tue, 16 Dec 2025 07:43:44 +0100 Subject: [PATCH] ci: Simplify workflow for watchdog build (no game source compilation) Main branch now builds watchdog-only image that auto-updates from CDN. Dev branch retains the full game source build workflow. --- .github/workflows/main.yml | 74 +++++--------------------------------- 1 file changed, 8 insertions(+), 66 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00c01a0..40d189f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,54 +1,28 @@ # -name: Build and publish wylab SS14 server +name: Build SS14 Watchdog Server -# Build whenever the Docker wrapper changes. +# Build on main branch (watchdog) - simpler build, no game source compilation on: push: branches: ['main'] - repository_dispatch: - types: ['ss14-package-ready'] workflow_dispatch: -# Workflow-wide defaults. Adjust IMAGE_NAME/REGISTRY if you are publishing elsewhere. env: REGISTRY: git.wylab.me IMAGE_NAME: wylab/ws14-docker-linux-server - WYLAB_SOURCE_REPO: https://git.wylab.me/wylab/wylab-station-14.git - WYLAB_SOURCE_REF: master BUILDKIT_PROGRESS: plain jobs: build-arm64: - # Requires a self-hosted macOS arm64 runner runs-on: [self-hosted, macos-arm64] - timeout-minutes: 240 + timeout-minutes: 60 permissions: contents: read packages: write - env: - TARGET_PLATFORM: linux-arm64 steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Resolve wylab commit - id: wylab - env: - PAYLOAD_COMMIT: ${{ github.event.client_payload.commit }} - run: | - set -euo pipefail - if [ -n "${PAYLOAD_COMMIT}" ]; then - COMMIT="${PAYLOAD_COMMIT}" - else - REF="${WYLAB_SOURCE_REF}" - COMMIT=$(git ls-remote "${WYLAB_SOURCE_REPO}" "${REF}" | head -n1 | cut -f1) - fi - if [ -z "${COMMIT}" ]; then - echo "Unable to resolve commit to build." >&2 - exit 1 - fi - echo "commit=${COMMIT}" >> "$GITHUB_OUTPUT" - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -64,49 +38,23 @@ jobs: with: context: . platforms: linux/arm64 - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-arm64 - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-arm64,mode=max + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-watchdog-arm64 + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-watchdog-arm64,mode=max push: true tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:arm64 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64 - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.wylab.outputs.commit }}-arm64 - build-args: | - SOURCE_REPO=${{ env.WYLAB_SOURCE_REPO }} - SOURCE_REF=${{ steps.wylab.outputs.commit }} - TARGET_PLATFORM=${{ env.TARGET_PLATFORM }} build-amd64: - # Requires a self-hosted Linux amd64 runner runs-on: [self-hosted, linux-amd64] - timeout-minutes: 240 + timeout-minutes: 60 permissions: contents: read packages: write - env: - TARGET_PLATFORM: linux-x64 steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Resolve wylab commit - id: wylab - env: - PAYLOAD_COMMIT: ${{ github.event.client_payload.commit }} - run: | - set -euo pipefail - if [ -n "${PAYLOAD_COMMIT}" ]; then - COMMIT="${PAYLOAD_COMMIT}" - else - REF="${WYLAB_SOURCE_REF}" - COMMIT=$(git ls-remote "${WYLAB_SOURCE_REPO}" "${REF}" | head -n1 | cut -f1) - fi - if [ -z "${COMMIT}" ]; then - echo "Unable to resolve commit to build." >&2 - exit 1 - fi - echo "commit=${COMMIT}" >> "$GITHUB_OUTPUT" - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -122,17 +70,11 @@ jobs: with: context: . platforms: linux/amd64 - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-amd64 - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-amd64,mode=max + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-watchdog-amd64 + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-watchdog-amd64,mode=max push: true tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.wylab.outputs.commit }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:amd64 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.wylab.outputs.commit }}-amd64 - build-args: | - SOURCE_REPO=${{ env.WYLAB_SOURCE_REPO }} - SOURCE_REF=${{ steps.wylab.outputs.commit }} - TARGET_PLATFORM=${{ env.TARGET_PLATFORM }}