action-details-check.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. branches:
  7. - develop
  8. permissions:
  9. contents: read
  10. concurrency:
  11. group: details-check-${{ github.ref_name }}
  12. cancel-in-progress: true
  13. jobs:
  14. create-matrix:
  15. if: github.repository_owner == 'GameServerManagers'
  16. runs-on: ubuntu-latest
  17. outputs:
  18. matrix: ${{ steps.set-matrix.outputs.matrix }}
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v4
  22. - name: Generate matrix with generate-matrix.sh
  23. run: .github/scripts/details-check-generate-matrix.sh
  24. - name: Set Matrix
  25. id: set-matrix
  26. run: |
  27. shortnamearray=$(cat shortnamearray.json)
  28. echo "${shortnamearray}"
  29. echo -n "matrix=${shortnamearray}" >> "$GITHUB_OUTPUT"
  30. details-check:
  31. if: github.repository_owner == 'GameServerManagers'
  32. needs: create-matrix
  33. continue-on-error: true
  34. runs-on: ubuntu-latest
  35. strategy:
  36. matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
  37. steps:
  38. - name: Download linuxgsm.sh
  39. run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh
  40. - name: Install dependencies
  41. run: sudo apt-get install libxml2-utils jq
  42. - name: Create serverfiles directory
  43. run: mkdir -p serverfiles
  44. - name: Grab server
  45. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server
  46. - name: Enable developer mode
  47. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer
  48. - name: Generate servercfgname
  49. id: sets-servercfgname
  50. run: |
  51. servercfg=$(sed -n "/^\<servercfgdefault\>/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg)
  52. echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT"
  53. - name: Download config
  54. run: |
  55. if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
  56. echo "This game server has no config file."
  57. else
  58. curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}"
  59. fi
  60. - name: Pre-load LinuxGSM
  61. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details
  62. - name: Display config
  63. run: |
  64. if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
  65. echo "This game server has no config file."
  66. else
  67. cat config
  68. fi
  69. - name: Display parameters
  70. run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
  71. - name: Details
  72. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details
  73. - name: Detect details
  74. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server parse-game-details
  75. - name: Query Raw
  76. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw