From ff4c4c806a9a9a41915b4eff736dd75eb01eb3dd Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Thu, 12 Oct 2023 04:12:15 +0000
Subject: [PATCH] Update .gitlab-ci.yml file split build job for each target:
 x86-64, Win32, Win64

---
 .gitlab-ci.yml | 45 ++++++++++++++++++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 11 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1ceaa1ef1..88872359f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,8 +21,7 @@
 stages:          # List of stages for jobs, and their order of execution
   - build
 
-
-build-native:       # This job runs in the build stage, which runs first.
+.job_template: &job_build # This job runs in the build stage, which runs first.
   stage: build
   image: debian:stable-slim
   variables:
@@ -40,10 +39,6 @@ build-native:       # This job runs in the build stage, which runs first.
       paths:
         - apt-cache
       unprotect: true
-  artifacts:
-    paths:
-      - "bin/*"
-    name: "Debian native"
   before_script:
     - apt-get update
     - export APT_CACHE_DIR=`pwd`/apt-cache
@@ -58,11 +53,39 @@ build-native:       # This job runs in the build stage, which runs first.
     - export CCACHE_BASEDIR="$PWD"
     - export CCACHE_DIR="$PWD/ccache"
     - ccache --show-stats
+
+.default_Scripts: &ccache
+  - export CCACHE_BASEDIR="$PWD"
+  - export CCACHE_DIR="$PWD/ccache"
+  - export CCACHE_COMPILERCHECK=content
+
+build-x86_64-linux-gnu:
+  <<: *job_build
+  artifacts:
+    paths:
+      - "bin/lsdl2srb2*"
+    name: "x86-64"
   script:
-    - export CCACHE_BASEDIR="$PWD"
-    - export CCACHE_DIR="$PWD/ccache"
-    - export CCACHE_COMPILERCHECK=content
-    - make --directory=src CCACHE=1
-    - make --directory=src CCACHE=1 MINGW64=1 PREFIX=x86_64-w64-mingw32
+    - *ccache
+    - export CC="x86_64-linux-gnu-gcc
+    - make --directory=src CCACHE=1 LINUX64=1
 
+build-i686-w64-mingw32:
+  <<: *job_build
+  artifacts:
+    paths:
+      - "bin/srb2win.exe*"
+    name: "Win32"
+  script:
+    - *ccache
+    - make --directory=src CCACHE=1 MINGW=1 PREFIX=i686-w64-mingw32
 
+build-x86_64-w64-mingw32:
+  <<: *job_build
+  artifacts:
+    paths:
+      - "bin/srb2win64.exe*"
+    name: "Win64"
+  script:
+    - *ccache
+    - make --directory=src CCACHE=1 MINGW64=1 PREFIX=x86_64-w64-mingw32
-- 
GitLab