details-check.yml 3.1 KB

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