Merge electron-build + deploy into single job, skip artifacts

Build + deploy in one step via Docker socket (docker cp).
Fixes 413 Request Entity Too Large on artifact upload.
Installs Docker CLI + mono-devel in before_script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-07 20:09:23 +01:00
parent 8b8a905343
commit 9d5f177bd5

View file

@ -68,8 +68,9 @@ docker-build:
$DESTINATIONS
electron-build:
stage: build
stage: deploy
image: electronuserland/builder:wine
needs: [deploy]
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
@ -78,8 +79,11 @@ electron-build:
- if: $CI_COMMIT_BRANCH == "main"
when: manual
allow_failure: true
variables:
CONTAINER_NAME: "gaming-hub"
before_script:
- apt-get update && apt-get install -y --no-install-recommends mono-devel && rm -rf /var/lib/apt/lists/*
- curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz | tar xzv --strip-components=1 -C /usr/local/bin docker/docker
script:
- |
VERSION=$(cat VERSION 2>/dev/null || echo "0.0.0")
@ -95,10 +99,26 @@ electron-build:
"
npm ci --no-audit --no-fund
npx electron-forge make --platform win32 --arch x64
artifacts:
paths:
- electron/out/make/squirrel.windows/x64/
expire_in: 1 hour
# --- Deploy directly (no artifact upload needed) ---
SRC_DIR="out/make/squirrel.windows/x64"
echo "[Electron Deploy] Deploying v${VERSION} to container..."
docker exec "$CONTAINER_NAME" mkdir -p /data/downloads
docker cp "${SRC_DIR}/RELEASES" "${CONTAINER_NAME}:/data/downloads/RELEASES"
for f in ${SRC_DIR}/*.nupkg; do
docker cp "$f" "${CONTAINER_NAME}:/data/downloads/$(basename "$f")"
done
SETUP_EXE=$(ls ${SRC_DIR}/*Setup*.exe 2>/dev/null | head -1)
if [ -n "$SETUP_EXE" ]; then
docker cp "$SETUP_EXE" "${CONTAINER_NAME}:/data/downloads/GamingHub-Setup.exe"
echo "[Electron Deploy] Setup.exe deployed: $(basename "$SETUP_EXE")"
fi
echo "[Electron Deploy] Files in /data/downloads/:"
docker exec "$CONTAINER_NAME" ls -lh /data/downloads/
deploy:
stage: deploy
@ -139,48 +159,6 @@ deploy:
"$DEPLOY_IMAGE"
- docker ps --filter name="$CONTAINER_NAME" --format "ID={{.ID}} Status={{.Status}} Image={{.Image}}"
electron-deploy:
stage: deploy
image: docker:latest
needs: [electron-build, deploy]
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- electron/**/*
- VERSION
- if: $CI_COMMIT_BRANCH == "main"
when: manual
allow_failure: true
variables:
CONTAINER_NAME: "gaming-hub"
script:
- |
VERSION=$(cat VERSION 2>/dev/null || echo "0.0.0")
SRC_DIR="electron/out/make/squirrel.windows/x64"
echo "[Electron Deploy] Deploying v${VERSION} artifacts..."
# Ensure downloads directory exists in container
docker exec "$CONTAINER_NAME" mkdir -p /data/downloads
# Copy RELEASES metadata
docker cp "${SRC_DIR}/RELEASES" "${CONTAINER_NAME}:/data/downloads/RELEASES"
# Copy nupkg (for Squirrel auto-update)
for f in ${SRC_DIR}/*.nupkg; do
docker cp "$f" "${CONTAINER_NAME}:/data/downloads/$(basename "$f")"
done
# Copy Setup.exe with stable name for download button
SETUP_EXE=$(ls ${SRC_DIR}/*Setup*.exe 2>/dev/null | head -1)
if [ -n "$SETUP_EXE" ]; then
docker cp "$SETUP_EXE" "${CONTAINER_NAME}:/data/downloads/GamingHub-Setup.exe"
echo "[Electron Deploy] Setup.exe deployed: $(basename "$SETUP_EXE")"
fi
echo "[Electron Deploy] Files in /data/downloads/:"
docker exec "$CONTAINER_NAME" ls -lh /data/downloads/
bump-version:
stage: bump-version
image: