Skip to content

Commit 2b16232

Browse files
authored
fix: support legacy game servers on older Ubuntu/Debian runners (#4903)
* fix(workflows): support legacy game servers on older Ubuntu/Debian runners Multiple game servers have glibc compatibility requirements that prevent them from running on Ubuntu 24.04: - bfv, bf1942: Require Ubuntu <= 22.04 or Debian <= 12 (glibc 2.31) - btl, onset: Require Ubuntu <= 20.04 or Debian <= 11 (glibc 2.31) Changes: - Add runner field to details-check matrix generation - Map legacy servers to appropriate ubuntu-XX.04 LTS runners - Modern servers continue on ubuntu-latest (24.04) - Update details-check.yml to use dynamic runner from matrix This ensures all server tests pass in CI without breaking modern server testing on current GitHub Actions runners. * fix(workflows): run details-check on PRs and normalize ref resolution Details Check was not running for PR #4903 because the workflow only triggered on push to develop/workflow_dispatch. Also, pull_request refs (refs/pull/*) are not valid raw-content refs for GitHub downloads. Changes: - Trigger Details Check on pull_request to develop - Add LGSM_REF env resolved to PR head SHA or branch ref name - Use LGSM_REF for linuxgsm.sh download and LGSM_GITHUBBRANCH usage - Use LGSM_REF in matrix generation when fetching serverlist.csv This ensures legacy server jobs (bfv, bf1942, btl, onset) are included and executed during PR validation. * fix(workflows): run update-check on PRs and normalize ref resolution Apply the same PR-safe workflow behavior used in details-check: - Trigger update-check on pull_request to develop - Resolve LGSM_REF to PR head SHA or branch ref name - Use LGSM_REF for linuxgsm.sh download and LGSM_GITHUBBRANCH calls This ensures update-check validates PR changes instead of only running on develop pushes. * fix(check_deps): avoid false Debian version check on Ubuntu Ubuntu reports ID_LIKE=debian, which caused Debian upper-version checks to run on Ubuntu and incorrectly fail legacy titles on Ubuntu 22.04.x. Use distroid==debian for Debian limits in legacy compatibility guards so: - bf1942/bfv pass on Ubuntu 22.04.x as intended - btl/onset limits still apply correctly - Debian limits still apply on Debian only * fix(workflows): add PR trigger to version-check; replace archived action in docker trigger version-check.yml: - Add pull_request trigger targeting develop so version format is validated on PRs before merge trigger-docker-build.yml: - Replace archived convictional/trigger-workflow-and-wait@v1.6.5 with native gh CLI approach (trigger + watch run ID) - Uses GH_TOKEN env var with PERSONAL_ACCESS_TOKEN secret - gh workflow run dispatches the workflow; gh run watch polls for completion and exits non-zero on failure, preserving job dependencies * fix(workflows): use timestamp filter to reliably identify triggered run ID Using --limit 1 to find the run ID is a race condition if another run of the same workflow starts concurrently. Capture a timestamp before dispatching and pass --created >=${before} to gh run list so we always select the run we just triggered. * remove pr check
1 parent 5a3c210 commit 2b16232

5 files changed

Lines changed: 74 additions & 31 deletions

File tree

.github/workflows/details-check-generate-matrix.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv
3+
ref="${LGSM_REF:-${GITHUB_REF#refs/heads/}}"
4+
curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${ref}/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv
45

56
echo -n "{" > "shortnamearray.json"
67
echo -n "\"include\":[" >> "shortnamearray.json"
@@ -14,10 +15,26 @@ while read -r line; do
1415
export gamename
1516
distro=$(echo "$line" | awk -F, '{ print $4 }')
1617
export distro
18+
# Legacy servers that require older Ubuntu/Debian versions due to glibc compatibility
19+
case "${shortname}" in
20+
bfv|bf1942)
21+
# Requires Ubuntu <= 22.04 or Debian <= 12 (glibc 2.31 compatible)
22+
runner="ubuntu-22.04"
23+
;;
24+
btl|onset)
25+
# Requires Ubuntu <= 20.04 or Debian <= 11 (glibc 2.31 compatible)
26+
runner="ubuntu-20.04"
27+
;;
28+
*)
29+
runner="ubuntu-latest"
30+
;;
31+
esac
1732
{
1833
echo -n "{";
1934
echo -n "\"shortname\":";
2035
echo -n "\"${shortname}\"";
36+
echo -n ",\"runner\":";
37+
echo -n "\"${runner}\"";
2138
echo -n "},";
2239
} >> "shortnamearray.json"
2340
done < <(tail -n +2 serverlist.csv)

.github/workflows/details-check.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
create-matrix:
1818
if: github.repository_owner == 'GameServerManagers'
1919
runs-on: ubuntu-latest
20+
env:
21+
LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }}
2022
outputs:
2123
matrix: ${{ steps.set-matrix.outputs.matrix }}
2224
steps:
@@ -37,14 +39,16 @@ jobs:
3739
if: github.repository_owner == 'GameServerManagers'
3840
needs: create-matrix
3941
continue-on-error: true
40-
runs-on: ubuntu-latest
42+
runs-on: ${{ matrix.runner }}
43+
env:
44+
LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }}
4145

4246
strategy:
4347
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
4448

4549
steps:
4650
- name: Download linuxgsm.sh
47-
run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh
51+
run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh
4852

4953
- name: Install dependencies
5054
run: sudo apt-get install libxml2-utils jq
@@ -53,10 +57,10 @@ jobs:
5357
run: mkdir -p serverfiles
5458

5559
- name: Grab server
56-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server
60+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server
5761

5862
- name: Enable developer mode
59-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer
63+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer
6064

6165
- name: Generate servercfgname
6266
id: sets-servercfgname
@@ -73,7 +77,7 @@ jobs:
7377
fi
7478
7579
- name: Pre-load LinuxGSM
76-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details
80+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details
7781

7882
- name: Display config
7983
run: |
@@ -87,10 +91,10 @@ jobs:
8791
run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
8892

8993
- name: Details
90-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details
94+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details
9195

9296
- name: Detect details
93-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server parse-game-details
97+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server parse-game-details
9498

9599
- name: Query Raw
96-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw
100+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server query-raw

.github/workflows/trigger-docker-build.yml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,22 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Trigger Workflow and Wait (linuxgsm)
18-
uses: convictional/trigger-workflow-and-wait@v1.6.5
19-
with:
20-
owner: GameServerManagers
21-
repo: docker-linuxgsm
22-
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
23-
workflow_file_name: action-docker-publish.yml
18+
env:
19+
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
20+
run: |
21+
before=$(date -u +%Y-%m-%dT%H:%M:%SZ)
22+
gh workflow run action-docker-publish.yml --repo GameServerManagers/docker-linuxgsm
23+
sleep 10
24+
run_id=$(gh run list \
25+
--workflow action-docker-publish.yml \
26+
--repo GameServerManagers/docker-linuxgsm \
27+
--created ">=${before}" \
28+
--limit 1 \
29+
--json databaseId \
30+
--jq '.[0].databaseId')
31+
gh run watch "${run_id}" \
32+
--repo GameServerManagers/docker-linuxgsm \
33+
--exit-status
2434
2535
trigger_build_docker-gameserver:
2636
if: github.repository_owner == 'GameServerManagers'
@@ -29,9 +39,19 @@ jobs:
2939
runs-on: ubuntu-latest
3040
steps:
3141
- name: Trigger Workflow and Wait (gameserver)
32-
uses: convictional/trigger-workflow-and-wait@v1.6.5
33-
with:
34-
owner: GameServerManagers
35-
repo: docker-gameserver
36-
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
37-
workflow_file_name: action-docker-publish.yml
42+
env:
43+
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
44+
run: |
45+
before=$(date -u +%Y-%m-%dT%H:%M:%SZ)
46+
gh workflow run action-docker-publish.yml --repo GameServerManagers/docker-gameserver
47+
sleep 10
48+
run_id=$(gh run list \
49+
--workflow action-docker-publish.yml \
50+
--repo GameServerManagers/docker-gameserver \
51+
--created ">=${before}" \
52+
--limit 1 \
53+
--json databaseId \
54+
--jq '.[0].databaseId')
55+
gh run watch "${run_id}" \
56+
--repo GameServerManagers/docker-gameserver \
57+
--exit-status

.github/workflows/update-check.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
update-check:
1717
if: github.repository_owner == 'GameServerManagers'
1818
runs-on: ubuntu-latest
19+
env:
20+
LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }}
1921

2022
strategy:
2123
fail-fast: false
@@ -24,30 +26,30 @@ jobs:
2426

2527
steps:
2628
- name: Download linuxgsm.sh
27-
run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh
29+
run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh
2830

2931
- name: Install dependencies
3032
run: sudo dpkg --add-architecture i386; sudo apt-get update;
3133

3234
- name: Grab server
33-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server
35+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server
3436

3537
- name: Enable developer mode
36-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer
38+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer
3739

3840
- name: Insert steamuser
3941
if: matrix.shortname == 'jk2'
4042
run: echo -e "steamuser=\"${{ secrets.STEAMCMD_USER }}\"\nsteampass='${{ secrets.STEAMCMD_PASS }}'" > lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg
4143

4244
- name: Install server
43-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install
45+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server auto-install
4446

4547
- name: Check Update server
46-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update
48+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server check-update
4749

4850
- name: Update server
49-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update
51+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server update
5052

5153
- name: Force Update server
5254
if: matrix.shortname == 'css'
53-
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update
55+
run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server force-update

lgsm/modules/check_deps.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,16 @@ if [ -n "${distrosupport}" ]; then
362362
fi
363363

364364
# These titles are only supported up to Ubuntu 22.04 (Jammy) and Debian 12 (Bookworm).
365-
if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then
365+
if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then
366366
if [ "${shortname}" == "bf1942" ] || [ "${shortname}" == "bfv" ]; then
367367
fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 22.04 or Debian <= 12)."
368368
fn_script_log_fail "${gamename} is not supported on ${distroname}."
369369
core_exit.sh
370370
fi
371371
fi
372372

373-
# These titles are only supported up to Ubuntu 20.04 and Debian 11 (and Debian-like derivatives).
374-
if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then
373+
# These titles are only supported up to Ubuntu 20.04 and Debian 11.
374+
if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then
375375
if [ "${shortname}" == "onset" ] || [ "${shortname}" == "btl" ]; then
376376
fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 20.04 or Debian <= 11)."
377377
fn_script_log_fail "${gamename} is not supported on ${distroname}."

0 commit comments

Comments
 (0)