details-check.yml 3.0 KB

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