-
-
Notifications
You must be signed in to change notification settings - Fork 821
85 lines (68 loc) · 3.01 KB
/
details-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This action will check that LinuxGSM is picking up game server config and parameter variables.
name: Details Check
on:
workflow_dispatch:
push:
concurrency:
group: details-check-${{ github.ref_name }}
cancel-in-progress: true
jobs:
create-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate matrix with generate-matrix.sh
run: chmod +x .github/workflows/detals-check-generate-matrix.sh; .github/workflows/detals-check-generate-matrix.sh
- name: Set Matrix
id: set-matrix
run: |
shortnamearray=$(cat shortnamearray.json)
echo "${shortnamearray}"
echo -n "matrix=${shortnamearray}" >> $GITHUB_OUTPUT
details-check:
needs: create-matrix
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
steps:
- name: Download linuxgsm.sh
run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh
- name: Install dependencies
run: sudo apt-get install libxml2-utils jq
- name: Create serverfiles directory
run: mkdir -p serverfiles
- name: Grab server
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server
- name: Enable developer mode
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer
- name: Generate servercfgname
id: sets-servercfgname
run: |
servercfg=$(sed -n "/^\<servercfgdefault\>/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg)
echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT"
- name: Download config
run: |
if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
echo "This game server has no config file."
else
curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}"
fi
- name: Display config
run: |
if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
echo "This game server has no config file."
else
cat config
fi
- name: Display parameters
run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
- name: Details
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details
- name: Detect details
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server detect-details
- name: Query Raw
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw