details-check.yml 2.8 KB

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