feat: kick/ban by IP #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: '**' | |
| tags-ignore: '**' | |
| paths: | |
| - 'lib/**' | |
| - 'GhostServer/**' | |
| - 'Makefile' | |
| - .github/workflows/CI.yaml | |
| pull_request: | |
| branches: '**' | |
| paths: | |
| - 'lib/**' | |
| - 'GhostServer/**' | |
| - 'Makefile' | |
| - .github/workflows/CI.yaml | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| QT_VS_ADDIN_URL: https://download.qt.io/archive/vsaddin/3.4.1/qt-vsaddin-msvc2022-x64-3.4.1.vsix | |
| jobs: | |
| build-lin: | |
| name: Linux Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: { fetch-depth: 0 } | |
| - name: Install Dependencies | |
| run: sudo apt-get install -y g++-10-multilib qtbase6-dev | |
| - name: Build | |
| run: make -j$(nproc) | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GhostServer-linux | |
| path: | | |
| ./ghost_server | |
| ./ghost_server_cli | |
| if-no-files-found: error | |
| build-win: | |
| name: Windows Build | |
| runs-on: windows-2022 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: { fetch-depth: 0 } | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| cache: 'true' | |
| cache-key-prefix: 'cache-qt' | |
| version: '6.10.0' | |
| arch: 'win64_msvc2022_64' | |
| dir: ${{ runner.temp }}/qt | |
| setup-python: 'false' | |
| - name: Cache QtMsBuild tools | |
| id: cache-qtmsbuild-tools | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{github.workspace}}/ExternalLibraries/qtvsaddin | |
| key: ${{ runner.os }}-qt-msbuild-cache | |
| - name: Get QtMsBuild tools | |
| if: steps.cache-qtmsbuild-tools.outputs.cache-hit != 'true' | |
| run: | | |
| Invoke-WebRequest -Uri ${{env.QT_VS_ADDIN_URL}} -MaximumRetryCount 10 -RetryIntervalSec 30 -OutFile vspackage.vsix | |
| Expand-Archive vspackage.vsix -DestinationPath ${{github.workspace}}/ExternalLibraries/qtvsaddin | |
| - name: Build GUI | |
| env: | |
| QtToolsPath: ${{ env.QT_ROOT_DIR }}\bin | |
| QtMsBuild: ${{github.workspace}}/ExternalLibraries/qtvsaddin/QtMsBuild | |
| run: msbuild -m -p:Configuration=DebugGUI GhostServer.sln | |
| - name: Build CLI | |
| run: msbuild -m -p:Configuration=DebugCLI GhostServer.sln | |
| - name: Deploy Qt | |
| shell: cmd | |
| run: | | |
| mkdir GhostServer-win | |
| copy /Y .\GhostServer.exe .\GhostServer-win\ | |
| copy /Y .\GhostServer_CLI.exe .\GhostServer-win\ | |
| cd GhostServer-win | |
| ${{ env.QT_ROOT_DIR }}\bin\windeployqt.exe --release --no-compiler-runtime --no-system-d3d-compiler --no-opengl-sw .\GhostServer.exe | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GhostServer-win | |
| path: GhostServer-win | |
| if-no-files-found: error |