336 changed files with 22023 additions and 358 deletions
@ -0,0 +1,74 @@ |
|||
name: Details Check |
|||
# This action will check that LinuxGSM is picking up game server config and parameter variables. |
|||
on: |
|||
workflow_dispatch: |
|||
push: |
|||
|
|||
jobs: |
|||
create-matrix: |
|||
runs-on: ubuntu-latest |
|||
outputs: |
|||
matrix: ${{ steps.set-matrix.outputs.matrix }} |
|||
steps: |
|||
- name: Checkout |
|||
uses: actions/checkout@v3 |
|||
|
|||
- name: Generate matrix with generate-matrix.sh |
|||
run: chmod +x .github/workflows/detals-check-generate-matrix.sh; .github/workflows/detals-check-generate-matrix.sh |
|||
|
|||
- 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: Install dependencies |
|||
run: sudo apt-get install libxml2-utils jq |
|||
|
|||
- name: Download linuxgsm.sh |
|||
run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh |
|||
|
|||
- 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 |
|||
|
|||
- id: sets-servercfgname |
|||
name: Generate 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 [ -z "${{ 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/rename/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" |
|||
fi |
|||
- name: Display config |
|||
run: | |
|||
if [ -z "${{ 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: 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 |
@ -0,0 +1,25 @@ |
|||
#!/bin/bash |
|||
|
|||
curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv |
|||
|
|||
echo -n "{" > "shortnamearray.json" |
|||
echo -n "\"include\":[" >> "shortnamearray.json" |
|||
|
|||
while read -r line; do |
|||
shortname=$(echo "$line" | awk -F, '{ print $1 }') |
|||
export shortname |
|||
servername=$(echo "$line" | awk -F, '{ print $2 }') |
|||
export servername |
|||
gamename=$(echo "$line" | awk -F, '{ print $3 }') |
|||
export gamename |
|||
distro=$(echo "$line" | awk -F, '{ print $4 }') |
|||
export distro |
|||
echo -n "{" >> "shortnamearray.json" |
|||
echo -n "\"shortname\":" >> "shortnamearray.json" |
|||
echo -n "\"${shortname}\"" >> "shortnamearray.json" |
|||
echo -n "}," >> "shortnamearray.json" |
|||
done < serverlist.csv |
|||
sed -i '$ s/.$//' "shortnamearray.json" |
|||
echo -n "]" >> "shortnamearray.json" |
|||
echo -n "}" >> "shortnamearray.json" |
|||
rm serverlist.csv |
@ -0,0 +1,22 @@ |
|||
#!/bin/bash |
|||
echo "Checking that all the game servers are listed in all csv files" |
|||
echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files" |
|||
# count the number of lines in the serverlist.csv |
|||
cd "lgsm/data" || exit |
|||
serverlistcount="$(wc -l < serverlist.csv)" |
|||
echo "serverlistcount: $serverlistcount" |
|||
# get list of all csv files starting with ubunutu debian centos |
|||
csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$')" |
|||
# loop though each csv file and make sure the number of lines is the same as the serverlistcount |
|||
for csv in $csvlist; do |
|||
csvcount="$(wc -l < "${csv}")" |
|||
csvcount=$((csvcount-2)) |
|||
if [ "$csvcount" -ne "$serverlistcount" ]; then |
|||
echo "ERROR: $csv ($csvcount) does not match serverlist.csv ($serverlistcount)" |
|||
exitcode=1 |
|||
else |
|||
echo "OK: $csv ($csvcount) and serverlist.csv ($serverlistcount) match" |
|||
fi |
|||
done |
|||
|
|||
exit ${exitcode} |
@ -0,0 +1,13 @@ |
|||
name: Server list Validation |
|||
on: |
|||
workflow_dispatch: |
|||
push: |
|||
|
|||
jobs: |
|||
serverlist-validate: |
|||
runs-on: ubuntu-latest |
|||
steps: |
|||
- uses: actions/checkout@v3 |
|||
|
|||
- name: compare versions |
|||
run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh |
@ -1,26 +1,15 @@ |
|||
# This is a basic workflow to help you get started with Actions |
|||
|
|||
name: Version Check |
|||
|
|||
# Controls when the action will run. Triggers the workflow on push or pull request |
|||
# events but only for the master branch |
|||
on: push |
|||
|
|||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
|||
permissions: |
|||
contents: read |
|||
|
|||
jobs: |
|||
# This workflow contains a single job called "build" |
|||
Version-Check: |
|||
# The type of runner that the job will run on |
|||
version-Check: |
|||
runs-on: ubuntu-latest |
|||
|
|||
# Steps represent a sequence of tasks that will be executed as part of the job |
|||
steps: |
|||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
|||
- uses: actions/checkout@v3 |
|||
|
|||
# Runs a single command using the runners shell |
|||
- name: compare versions |
|||
run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh |
|||
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 7.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Can't render this file because it has a wrong number of fields in line 2.
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue