details-check.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. name: Details Check
  2. # This action will check that LinuxGSM is picking up game server config and parameter variables.
  3. on:
  4. workflow_dispatch:
  5. push:
  6. jobs:
  7. create-matrix:
  8. runs-on: ubuntu-latest
  9. outputs:
  10. matrix: ${{ steps.set-matrix.outputs.matrix }}
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v3
  14. - name: Generate matrix with generate-matrix.sh
  15. run: chmod +x .github/workflows/detals-check-generate-matrix.sh; .github/workflows/detals-check-generate-matrix.sh
  16. - id: set-matrix
  17. run: |
  18. shortnamearray=$(cat shortnamearray.json)
  19. echo "${shortnamearray}"
  20. echo -n "matrix=${shortnamearray}" >> $GITHUB_OUTPUT
  21. details-check:
  22. needs: create-matrix
  23. continue-on-error: true
  24. runs-on: ubuntu-latest
  25. strategy:
  26. matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
  27. steps:
  28. - name: Install dependencies
  29. run: sudo apt-get install libxml2-utils jq
  30. - name: Download linuxgsm.sh
  31. run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh
  32. - name: Grab server
  33. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server
  34. - name: Enable developer mode
  35. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer
  36. - id: sets-servercfgname
  37. name: Generate servercfgname
  38. run: |
  39. servercfg=$(sed -n "/^\<servercfgdefault\>/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg)
  40. echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT"
  41. - name: Download config
  42. run: |
  43. if [ -z "${{ steps.sets-servercfgname.outputs.servercfgname }}" ]; then
  44. echo "This game server has no config file."
  45. else
  46. curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/rename/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}"
  47. fi
  48. - name: Display config
  49. run: |
  50. if [ -z "${{ steps.sets-servercfgname.outputs.servercfgname }}" ]; then
  51. echo "This game server has no config file."
  52. else
  53. cat config
  54. fi
  55. - name: Display parameters
  56. run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
  57. - name: Details
  58. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details
  59. - name: Detect details
  60. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server detect-details
  61. - name: Query Raw
  62. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw