4
0

details-check.yml 3.3 KB

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