details-check.yml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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: Display config
  59. run: |
  60. if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then
  61. echo "This game server has no config file."
  62. else
  63. cat config
  64. fi
  65. - name: Display parameters
  66. run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg
  67. - name: Details
  68. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details
  69. - name: Detect details
  70. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server parse-game-details
  71. - name: Query Raw
  72. run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw