diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..203f3c889b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 26c1df5317..9ec2a07399 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: MacOs build +name: macOS Build on: [push] @@ -7,9 +7,8 @@ env: BUILD_TYPE: Release REPO_DIR : ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/bin/builddir + BOOST_VERSION: "1.83.0" BOOST_PLATFORM_VERSION: "11" - BOOST_VERSION: "1.79.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" permissions: contents: read @@ -22,43 +21,34 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{env.REPO_DIR}} - - name: Install dependencies + - name: Install Dependencies run: | brew install mysql-client brew install openssl echo "OPENSSL_ROOT_DIR=$(brew --prefix --installed openssl)" >> $GITHUB_ENV - mkdir -p ${{env.BOOST_INSTALL_DIR}} - - name: Cache Windows boost - uses: actions/cache@v2 - id: cache-boost - with: - path: "${{env.BOOST_INSTALL_DIR}}/boost" - key: ${{ runner.os }}-${{ hashFiles('.github/workflows/macos.yml') }} - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 + - name: Install Boost + uses: MarkusJx/install-boost@v2.4.5 id: install-boost with: # REQUIRED: Specify the required boost version # A list of supported versions can be found here: - # https://github.com/actions/boost-versions/blob/main/versions-manifest.json + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json boost_version: ${{env.BOOST_VERSION}} # OPTIONAL: Specify a platform version platform_version: ${{env.BOOST_PLATFORM_VERSION}} - # OPTIONAL: Specify a custom install location - boost_install_dir: ${{env.BOOST_INSTALL_DIR}} # OPTIONAL: Specify a toolset toolset: clang + # NOTE: If a boost version matching all requirements cannot be found, + # this build step will fail - name: Configure env: - BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost" + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} run: cmake -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} -DBoost_ARCHITECTURE=-x64 - name: Build @@ -69,31 +59,29 @@ jobs: notify: permissions: contents: none - name: Discord Notification + name: Send Notification to Discord on Failure runs-on: ubuntu-20.04 needs: # make sure the notification is sent AFTER the jobs you want included have completed - build if: failure() steps: - - name: Env + - name: Setup Environmental Variables run: | echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV echo "GIT_SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 + uses: rjstone/discord-webhook-notify@v1.1.1 with: severity: error - username: ${{env.EXPENSION_NAME}}-core description: | - **MacOS buid failed** + **macOS Build Failed** details: | - **Branch:** ${{env.GIT_BRANCH}} - **Pusher:** ${{github.event.pusher.name}} - **Author:** ${{github.event.head_commit.author.name}} - **Commit:** [${{github.repository}}/${{env.GIT_SHORT_SHA}}](${{github.server_url}}/${{ github.repository }}/commit/${{github.sha}}) - - **Build log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Next time ${{github.event.pusher.name}}! + - **Build Log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) + footer: CMaNGOS Developers Notified! webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 31650f91da..7c5f0e1e42 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,4 +1,4 @@ -name: Ubuntu build +name: Ubuntu Build on: [push] @@ -7,9 +7,8 @@ env: BUILD_TYPE: Release REPO_DIR : ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/bin/builddir - BOOST_PLATFORM_VERSION: "20.04" - BOOST_VERSION: "1.79.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" + BOOST_VERSION: "1.83.0" + BOOST_PLATFORM_VERSION: "22.04" jobs: build: @@ -20,19 +19,19 @@ jobs: strategy: matrix: include: - - os: ubuntu-20.04 - COMPILER_CC: gcc - COMPILER_PP: g++ + - os: ubuntu-22.04 + COMPILER_CC: gcc-12 + COMPILER_PP: g++-12 USE_PCH: ON EXTRA_BUILD: "" - - os: ubuntu-20.04 + - os: ubuntu-22.04 COMPILER_CC: clang COMPILER_PP: clang++ USE_PCH: ON EXTRA_BUILD: "-DBUILD_EXTRACTORS=ON -DBUILD_AHBOT=ON -DBUILD_PLAYERBOT=ON " - - os: ubuntu-20.04 + - os: ubuntu-22.04 COMPILER_CC: clang COMPILER_PP: clang++ USE_PCH: OFF @@ -40,7 +39,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{env.REPO_DIR}} @@ -52,46 +51,41 @@ jobs: echo "CXX=${{matrix.COMPILER_PP}}" >> $GITHUB_ENV cmake -E make_directory ${{ env.BUILD_DIR }} - - name: Cache Windows boost - uses: actions/cache@v2 - id: cache-boost - with: - path: "${{env.BOOST_INSTALL_DIR}}/boost" - key: ${{ runner.os }}-${{ hashFiles('.github/workflows/ubuntu.yml') }} - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 + - name: Install Boost + uses: MarkusJx/install-boost@v2.4.5 id: install-boost with: # REQUIRED: Specify the required boost version # A list of supported versions can be found here: - # https://github.com/actions/boost-versions/blob/main/versions-manifest.json + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json boost_version: ${{env.BOOST_VERSION}} # OPTIONAL: Specify a platform version platform_version: ${{env.BOOST_PLATFORM_VERSION}} - # OPTIONAL: Specify a custom install location - boost_install_dir: ${{env.BOOST_INSTALL_DIR}} # OPTIONAL: Specify a toolset toolset: ${{env.COMPILER_CC}} # OPTIONAL: Specify an architecture arch: x86 + # NOTE: If a boost version matching all requirements cannot be found, + # this build step will fail - name: Configure env: USE_PCH: ${{ matrix.USE_PCH }} EXTRA_BUILD: ${{ matrix.EXTRA_BUILD }} - BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost" - run: cmake -DBoost_ARCHITECTURE=-x64 -DPCH=${{env.USE_PCH}} ${{env.EXTRA_BUILD}}-B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} + run: cmake -DBoost_ARCHITECTURE=-x64 -DPCH=${{env.USE_PCH}} -DCMAKE_INSTALL_PREFIX=/home/runner/work ${{env.EXTRA_BUILD}}-B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} + - name: Build env: MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} + run: | + cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} + cmake --install ${{env.BUILD_DIR}} notify: - name: Discord Notification - runs-on: ubuntu-20.04 + name: Send Notification to Discord on Failure + runs-on: ubuntu-22.04 permissions: contents: none needs: # make sure the notification is sent AFTER the jobs you want included have completed @@ -99,24 +93,22 @@ jobs: if: failure() steps: - - name: Env + - name: Setup Environmental Variables run: | echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV echo "GIT_SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 + uses: rjstone/discord-webhook-notify@v1.1.1 with: severity: error - username: ${{env.EXPENSION_NAME}}-core description: | - **Linux buid failed** + **Linux Build Failed** details: | - **Branch:** ${{env.GIT_BRANCH}} - **Pusher:** ${{github.event.pusher.name}} - **Author:** ${{github.event.head_commit.author.name}} - **Commit:** [${{github.repository}}/${{env.GIT_SHORT_SHA}}](${{github.server_url}}/${{ github.repository }}/commit/${{github.sha}}) - - **Build log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Next time ${{github.event.pusher.name}}! + - **Build Log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) + footer: CMaNGOS Developers Notified! webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml index 0e92164f12..d26be8b9ae 100644 --- a/.github/workflows/windows-release.yml +++ b/.github/workflows/windows-release.yml @@ -1,4 +1,4 @@ -name: Windows release build +name: Windows Release Build # on: @@ -12,8 +12,8 @@ env: REPO_DIR : ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/bin/builddir BOOST_TOOLSET: "msvc" - BOOST_VERSION: "1.79.0.beta1" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" + BOOST_VERSION: "1.83.0" + BOOST_PLATFORM_VERSION: "2022" jobs: build: @@ -27,13 +27,13 @@ jobs: - OPTIONAL_DEFINES: "" TYPE: "default" - - OPTIONAL_DEFINES: "-DBUILD_EXTRACTORS=ON -DBUILD_PLAYERBOT=ON -DBUILD_AHBOT=ON -DBUILD_RECASTDEMOMOD=ON -DBUILD_GIT_ID=ON" + - OPTIONAL_DEFINES: "-DBUILD_EXTRACTORS=ON -DBUILD_PLAYERBOTS=ON -DBUILD_AHBOT=ON -DBUILD_RECASTDEMOMOD=ON -DBUILD_GIT_ID=ON" TYPE: "with-all" - - OPTIONAL_DEFINES: "-DBUILD_PLAYERBOT=ON -DBUILD_AHBOT=ON" + - OPTIONAL_DEFINES: "-DBUILD_PLAYERBOTS=ON -DBUILD_AHBOT=ON" TYPE: "with-playerbot-ahbot" - - OPTIONAL_DEFINES: "-DBUILD_PLAYERBOT=ON" + - OPTIONAL_DEFINES: "-DBUILD_PLAYERBOTS=ON" TYPE: "with-playerbot" - OPTIONAL_DEFINES: "-DBUILD_AHBOT=ON" @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{env.REPO_DIR}} @@ -52,33 +52,24 @@ jobs: cmake -E make_directory ${{ env.BUILD_DIR }} # install dependencies - - name: Cache Windows boost - uses: actions/cache@v2 - id: cache-boost - with: - path: "${{env.BOOST_INSTALL_DIR}}/boost" - key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows-release.yml') }} - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 + - name: Install Boost + uses: MarkusJx/install-boost@v2.4.5 id: install-boost with: # REQUIRED: Specify the required boost version # A list of supported versions can be found here: - # https://github.com/actions/boost-versions/blob/main/versions-manifest.json + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a toolset on windows + # OPTIONAL: Specify a platform version + platform_version: ${{env.BOOST_PLATFORM_VERSION}} + # OPTIONAL: Specify a toolset toolset: ${{env.BOOST_TOOLSET}} - # OPTIONAL: Specify a custon install location - boost_install_dir: ${{env.BOOST_INSTALL_DIR}} - platform_version: 2022 # NOTE: If a boost version matching all requirements cannot be found, # this build step will fail - name: Configure env: - BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost" + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} run: cmake ${{matrix.OPTIONAL_DEFINES}} -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - name: Build @@ -88,13 +79,14 @@ jobs: - name: Archive files run: | - cd bin + cd ${{env.BUILD_DIR}}/bin 7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}" - - name: Archive this artefact - uses: actions/upload-artifact@v2 + + - name: Archive The Artefact + uses: actions/upload-artifact@v4 with: name: snapshot-${{matrix.TYPE}} - path: "bin/${{env.ARCHIVE_FILENAME}}" + path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" upload: runs-on: windows-2022 @@ -103,37 +95,37 @@ jobs: needs: build steps: - - name: Download artifact snapshot-default - uses: actions/download-artifact@v1 + - name: Download Artifact snapshot-default + uses: actions/download-artifact@v4 with: name: snapshot-default path: all_snapshots - - name: Download artifact snapshot-with-all - uses: actions/download-artifact@v1 + - name: Download Artifact snapshot-with-all + uses: actions/download-artifact@v4 with: name: snapshot-with-all path: all_snapshots - - name: Download artifact snapshot-with-playerbot-ahbot - uses: actions/download-artifact@v1 + - name: Download Artifact snapshot-with-playerbot-ahbot + uses: actions/download-artifact@v4 with: name: snapshot-with-playerbot-ahbot path: all_snapshots - - name: Download artifact snapshot-with-playerbot - uses: actions/download-artifact@v1 + - name: Download Artifact snapshot-with-playerbot + uses: actions/download-artifact@v4 with: name: snapshot-with-playerbot path: all_snapshots - - name: Download artifact snapshot-with-ahbot - uses: actions/download-artifact@v1 + - name: Download Artifact snapshot-with-ahbot + uses: actions/download-artifact@v4 with: name: snapshot-with-ahbot path: all_snapshots - - name: Get current date + - name: Get Current Date id: date run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - name: Upload snapshot + - name: Upload Snapshot uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" @@ -143,7 +135,7 @@ jobs: files: all_snapshots notify-success: - name: Discord release successfully notification + name: Send Notification to Discord on Success runs-on: ubuntu-20.04 permissions: contents: none @@ -151,14 +143,14 @@ jobs: - upload steps: - - name: Set environmental variables + - name: Set Environmental Variables run: | echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV shortSHA=`echo ${GITHUB_SHA} | cut -c1-8` echo "GIT_SHORT_SHA=${shortSHA}" >> $GITHUB_ENV projectNames="${GITHUB_REPOSITORY#*/}" - expension="${projectNames#*-}" - echo "EXPENSION_NAME=${expension}" >> $GITHUB_ENV + expansion="${projectNames#*-}" + echo "EXPANSION_NAME=${expansion}" >> $GITHUB_ENV echo "DEFAULT_ARCH_NAME=${projectNames}-default-${shortSHA}.zip" >> $GITHUB_ENV echo "ALL_ARCH_NAME=${projectNames}-with-all-${shortSHA}.zip" >> $GITHUB_ENV echo "AB_ARCH_NAME=${projectNames}-with-ahbot-${shortSHA}.zip" >> $GITHUB_ENV @@ -166,26 +158,27 @@ jobs: echo "PB_AB_ARCH_NAME=${projectNames}-with-playerbot-ahbot-${shortSHA}.zip" >> $GITHUB_ENV - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 + uses: rjstone/discord-webhook-notify@v1.1.1 with: severity: info - username: ${{env.EXPENSION_NAME}}-core description: | - **${{env.EXPENSION_NAME}} prebuilt have just been released** + **New ${{env.EXPANSION_NAME}} Prebuild Released!** details: | **Branch:** ${{env.GIT_BRANCH}} - __**Winodws prebuild Binaries**__ - - [Default download](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.DEFAULT_ARCH_NAME}}) - - [All options on](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.ALL_ARCH_NAME}}) - - [AhBot enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.AB_ARCH_NAME}}) - - [PlayerBot enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.PB_ARCH_NAME}}) - - [AhBot and PlayerBot enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.PB_AB_ARCH_NAME}}) - footer: By CMaNGOS team! + __**Windows Prebuilt Binaries**__ + + - [Default Download](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.DEFAULT_ARCH_NAME}}) + - [All Options Enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.ALL_ARCH_NAME}}) + - [AHBot Enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.AB_ARCH_NAME}}) + - [PlayerBots Enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.PB_ARCH_NAME}}) + - [AHBot & PlayerBots Enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.PB_AB_ARCH_NAME}}) + + If you find any bugs or issues please report them [here](https://github.com/cmangos/issues/issues/new/choose). + footer: Created by the CMaNGOS Team! webhookUrl: ${{ secrets.DISCORD_WEBHOOK_RELEASE }} - avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png notify: - name: Discord Notification + name: Send Notification to Discord on Failure runs-on: ubuntu-20.04 permissions: contents: none @@ -200,18 +193,16 @@ jobs: echo "GIT_SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 + uses: rjstone/discord-webhook-notify@v1.1.1 with: severity: error - username: ${{env.EXPENSION_NAME}}-core description: | - **Windows buid failed** + **Windows Build Failed** details: | - **Branch:** ${{env.GIT_BRANCH}} - **Pusher:** ${{github.event.pusher.name}} - **Author:** ${{github.event.head_commit.author.name}} - **Commit:** [${{github.repository}}/${{env.GIT_SHORT_SHA}}](${{github.server_url}}/${{ github.repository }}/commit/${{github.sha}}) - - **Build log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: CMaNGOS police called! + - **Build Log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) + footer: CMaNGOS Developers Notified! webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bd075954f2..32c8f41c7d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,5 +1,5 @@ -name: Windows build +name: Windows Build on: [push] @@ -9,8 +9,8 @@ env: REPO_DIR : ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/bin/builddir BOOST_TOOLSET: "msvc" - BOOST_VERSION: "1.79.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" + BOOST_VERSION: "1.83.0" + BOOST_PLATFORM_VERSION: "2022" jobs: build: @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{env.REPO_DIR}} @@ -31,33 +31,24 @@ jobs: cmake -E make_directory ${{ env.BUILD_DIR }} # install dependencies - - name: Cache Windows boost - uses: actions/cache@v2 - id: cache-boost - with: - path: "${{env.BOOST_INSTALL_DIR}}/boost" - key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }} - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 + - name: Install Boost + uses: MarkusJx/install-boost@v2.4.5 id: install-boost with: # REQUIRED: Specify the required boost version # A list of supported versions can be found here: - # https://github.com/actions/boost-versions/blob/main/versions-manifest.json + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a toolset on windows + # OPTIONAL: Specify a platform version + platform_version: ${{env.BOOST_PLATFORM_VERSION}} + # OPTIONAL: Specify a toolset toolset: ${{env.BOOST_TOOLSET}} - # OPTIONAL: Specify a custon install location - boost_install_dir: ${{env.BOOST_INSTALL_DIR}} - platform_version: 2022 # NOTE: If a boost version matching all requirements cannot be found, # this build step will fail - + - name: Configure env: - BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost" + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} run: cmake -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - name: Build @@ -65,19 +56,19 @@ jobs: MAKEFLAGS: "-j8" run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - name: Archive files + - name: Archive Files run: | - cd bin + cd ${{env.BUILD_DIR}}/bin 7z a -tzip ${{env.ARCHIVE_FILENAME}} x64_Release - - name: Archive this artefact - uses: actions/upload-artifact@v2 + - name: Archive The Artifact + uses: actions/upload-artifact@v4 with: name: snapshot - path: "bin/${{env.ARCHIVE_FILENAME}}" + path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" notify: - name: Discord Notification + name: Send Notification to Discord on Failure runs-on: ubuntu-20.04 permissions: contents: none @@ -86,24 +77,22 @@ jobs: if: failure() steps: - - name: Env + - name: Setup Environmental Variables run: | echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV echo "GIT_SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 + uses: rjstone/discord-webhook-notify@v1.1.1 with: severity: error - username: ${{env.EXPENSION_NAME}}-core description: | - **Windows buid failed** + **Windows Build Failed** details: | - **Branch:** ${{env.GIT_BRANCH}} - **Pusher:** ${{github.event.pusher.name}} - **Author:** ${{github.event.head_commit.author.name}} - **Commit:** [${{github.repository}}/${{env.GIT_SHORT_SHA}}](${{github.server_url}}/${{ github.repository }}/commit/${{github.sha}}) - - **Build log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Next time ${{github.event.pusher.name}}! + - **Build Log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) + footer: CMaNGOS Developers Notified! webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png diff --git a/.gitignore b/.gitignore index 041d34d401..3b2390e4bf 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,8 @@ cmake_install.cmake # recastnavigation directory needs exception !dep/recastnavigation/RecastDemo/Build/ /_build/ + +# +# Module files +# +src/modules/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c3b0299f9e..9325cb0ae0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ MACRO(DisableWarnings) set(SearchWarningsFlag2 "/Wall") else() set(DisableWarningsFlag "-w") - set(SearchWarningsFlag1 "-[+W?]pedentic") + set(SearchWarningsFlag1 "-[+W?]pedantic") set(SearchWarningsFlag2 "-Wall") endif() foreach(temp_flag @@ -156,10 +156,10 @@ if(WIN32) set(CONF_DIR ${BIN_DIR}) get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) # ninja generator does not support $(Configuration) if(MSVC AND "$ENV{CLION_IDE}" STREQUAL "" AND IS_MULTI_CONFIG) - set(DEV_BIN_DIR ${CMAKE_SOURCE_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_$(Configuration)) + set(DEV_BIN_DIR ${DEV_BINARY_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_$(Configuration)) set(DEV_PROVIDED_LIBS_FOLDER ${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_$(Configuration)) else() - set(DEV_BIN_DIR ${CMAKE_SOURCE_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_${CMAKE_BUILD_TYPE}) + set(DEV_BIN_DIR ${DEV_BINARY_DIR}/${BIN_FOLDER_NAME}/${DEP_ARCH}_${CMAKE_BUILD_TYPE}) set(DEV_PROVIDED_LIBS_FOLDER ${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_${CMAKE_BUILD_TYPE}) endif() @@ -251,37 +251,20 @@ endif() if(UNIX AND (BUILD_GAME_SERVER OR BUILD_LOGIN_SERVER OR BUILD_EXTRACTORS)) if(POSTGRESQL) find_package(PostgreSQL REQUIRED) + elseif(SQLITE) + find_package(SQLite3 REQUIRED) else() find_package(MySQL REQUIRED) endif() - if(APPLE) - find_package(OpenSSL QUIET) - if(NOT OpenSSL_FOUND AND NOT OPENSSL_FOUND) - # If OpenSSL path isn't specified on mac we set the one that Homebrew uses - # and try again. This typically makes CMake find the OpenSSL headers and version. - # Homebrew installs the OpenSSL libraries with a version in the library file names - # though, like libcrypto.1.1.dylib, but CMake doesn't seem to check that file name - # pattern and might eventually find a non-matching library installed by macOS in - # a default search path. To avoid that, we'll also point pkg-config to the Homebrew - # location for OpenSSL details, because CMake checks pkg-config info as well. - set(OPENSSL_ROOT_DIR /usr/local/opt/openssl) - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/openssl/lib/pkgconfig") - find_package(OpenSSL) - endif() - else() - find_package(OpenSSL) - endif() + find_package(OpenSSL REQUIRED) - if(NOT OpenSSL_FOUND AND NOT OPENSSL_FOUND) - message(FATAL_ERROR "OpenSSL not found!") - else() - if(OpenSSL_VERSION AND NOT OPENSSL_VERSION) - set(OPENSSL_VERSION ${OpenSSL_VERSION}) - endif() - if(OPENSSL_VERSION VERSION_LESS 1.1) - message(SEND_ERROR "OpenSSL: This project requires OpenSSL version 1.1.0 or higher") - endif() + message(STATUS "Found OpenSSL libraries: ${OPENSSL_LIBRARIES}") + if(OPENSSL_VERSION VERSION_LESS 1.1) + message(SEND_ERROR "OpenSSL: This project requires OpenSSL version 1.1.0 or higher") + endif() + if(OPENSSL_VERSION VERSION_LESS 1.1.1 OR (OPENSSL_VERSION VERSION_GREATER 3.0 AND OPENSSL_VERSION VERSION_LESS 3.0.7)) + message(WARNING "OpenSSL: Your OpenSSL version is critically vulnerable or no longer being maintained, consider upgrading") endif() endif() @@ -327,7 +310,7 @@ endif() configure_file( ${CMAKE_SOURCE_DIR}/src/shared/revision.h.in - ${CMAKE_SOURCE_DIR}/src/shared/revision.h + ${CMAKE_BINARY_DIR}/src/shared/revision.h @ONLY ) @@ -341,13 +324,25 @@ if(NOT BUILD_GAME_SERVER AND BUILD_SCRIPTDEV) message(STATUS "BUILD_SCRIPTDEV forced to OFF due to BUILD_GAME_SERVER is not set") endif() -if(NOT BUILD_GAME_SERVER AND BUILD_PLAYERBOT) - set(BUILD_PLAYERBOT OFF) - message(STATUS "BUILD_PLAYERBOT forced to OFF due to BUILD_GAME_SERVER is not set") +if(NOT BUILD_GAME_SERVER AND BUILD_DEPRECATED_PLAYERBOT) + set(BUILD_DEPRECATED_PLAYERBOT OFF) + message(STATUS "BUILD_DEPRECATED_PLAYERBOT forced to OFF due to BUILD_GAME_SERVER is not set") +endif() + +if(BUILD_PLAYERBOTS) + if(BUILD_DEPRECATED_PLAYERBOT) + set(BUILD_DEPRECATED_PLAYERBOT OFF) + message(STATUS "BUILD_DEPRECATED_PLAYERBOT forced to OFF because BUILD_PLAYERBOTS is set") + endif() + + if(NOT BUILD_GAME_SERVER) + set(BUILD_PLAYERBOTS OFF) + message(STATUS "BUILD_PLAYERBOTS forced to OFF due to BUILD_GAME_SERVER is not set") + endif() endif() if(PCH) - if(${CMAKE_VERSION} VERSION_LESS "3.16") + if(${CMAKE_VERSION} VERSION_LESS "3.16") message("PCH is not supported by your CMake version") message("Please consider to switch to CMake 3.16") message("PCH is forced to OFF") @@ -378,6 +373,8 @@ set(DEFINITIONS "") if(POSTGRESQL) set(DEFINITIONS ${DEFINITIONS} DO_POSTGRESQL) +elseif(SQLITE) + set(DEFINITIONS ${DEFINITIONS} DO_SQLITE) else() set(DEFINITIONS ${DEFINITIONS} DO_MYSQL) endif() diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake index fca9ff6e5d..6aee5bd2a3 100644 --- a/cmake/compiler/clang/settings.cmake +++ b/cmake/compiler/clang/settings.cmake @@ -1,7 +1,7 @@ # Set build-directive (used in core to tell which buildtype we used) add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"') -# Additional compaitibility checks and flags for commonly found LTS Clang versions +# Additional compatibility checks and flags for commonly found LTS Clang versions if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) # Set minimum C++17 compliant Clang version target to 7.0 message(SEND_ERROR "Clang: This project requires Clang version 7.0 or higher") diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake index 6372957b11..4c4ae80ba4 100644 --- a/cmake/compiler/gcc/settings.cmake +++ b/cmake/compiler/gcc/settings.cmake @@ -7,7 +7,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARM_FLAGS}") endif() -# Additional compaitibility checks and flags for commonly found LTS GCC versions +# Additional compatibility checks and flags for commonly found LTS GCC versions if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0 AND NOT MINGW) # Set minimum C++17 compliant GCC version target to 7.0 if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) @@ -15,6 +15,11 @@ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0 AND NOT MINGW) endif() endif() +# Blacklist buggy GCC versions +if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12 AND NOT MINGW) + message(WARNING "GCC: This version is known to be affected by internal compiler bugs, do upgrade if build fails") +endif() + add_definitions(-DHAVE_SSE2) message(STATUS "GCC: SFMT enabled, SSE2 flags forced") diff --git a/cmake/options.cmake b/cmake/options.cmake index 7455747cca..e180ee0e70 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -1,18 +1,20 @@ -option(DEBUG "Include additional debug-code in core" OFF) -option(WARNINGS "Show all warnings during compile" OFF) -option(POSTGRESQL "Use PostgreSQL" OFF) -option(PCH "Use precompiled headers" ON) -option(BUILD_GAME_SERVER "Build game server" ON) -option(BUILD_LOGIN_SERVER "Build login server" ON) -option(BUILD_EXTRACTORS "Build map/dbc/vmap/mmap extractors" OFF) -option(BUILD_SCRIPTDEV "Build ScriptDev. (OFF Speedup build)" ON) -option(BUILD_PLAYERBOT "Build Playerbot mod" OFF) -option(BUILD_AHBOT "Build Auction House Bot mod" OFF) -option(BUILD_METRICS "Build Metrics, generate data for Grafana" OFF) -option(BUILD_RECASTDEMOMOD "Build map/vmap/mmap viewer" OFF) -option(BUILD_GIT_ID "Build git_id" OFF) -option(BUILD_DOCS "Build documentation with doxygen" OFF) -option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "Enable link-time optimizations" OFF) +option(DEBUG "Include additional debug-code in core" OFF) +option(WARNINGS "Show all warnings during compile" OFF) +option(POSTGRESQL "Use PostgreSQL" OFF) +option(PCH "Use precompiled headers" ON) +option(BUILD_GAME_SERVER "Build game server" ON) +option(BUILD_LOGIN_SERVER "Build login server" ON) +option(BUILD_EXTRACTORS "Build map/dbc/vmap/mmap extractors" OFF) +option(BUILD_SCRIPTDEV "Build ScriptDev. (OFF Speedup build)" ON) +option(BUILD_PLAYERBOTS "Build Playerbots mod" OFF) +option(BUILD_AHBOT "Build Auction House Bot mod" OFF) +option(BUILD_METRICS "Build Metrics, generate data for Grafana" OFF) +option(BUILD_RECASTDEMOMOD "Build map/vmap/mmap viewer" OFF) +option(BUILD_GIT_ID "Build git_id" OFF) +option(BUILD_DOCS "Build documentation with doxygen" OFF) +option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "Enable link-time optimizations" OFF) +option(BUILD_DEPRECATED_PLAYERBOT "Build previous version of Playerbot mod" OFF) +set(DEV_BINARY_DIR ${CMAKE_BINARY_DIR} CACHE STRING "Executable directory on Windows") # TODO: options that should be checked/created: #option(CLI "With CLI" ON) @@ -32,13 +34,19 @@ message(STATUS BUILD_GAME_SERVER Build game server (core server) BUILD_LOGIN_SERVER Build login server (auth server) BUILD_EXTRACTORS Build map/dbc/vmap/mmap extractor - BUILD_SCRIPTDEV Build scriptdev. (Disable it to speedup build in dev mode by not including scripts) - BUILD_PLAYERBOT Build Playerbot mod + BUILD_PLAYERBOTS Build Playerbots mod BUILD_AHBOT Build Auction House Bot mod BUILD_METRICS Build Metrics, generate data for Grafana BUILD_RECASTDEMOMOD Build map/vmap/mmap viewer BUILD_GIT_ID Build git_id BUILD_DOCS Build documentation with doxygen + CMAKE_INTERPROCEDURAL_OPTIMIZATION Enable link-time optimizations + BUILD_DEPRECATED_PLAYERBOT Build Playerbot mod (deprecated) + BUILD_SCRIPTDEV Build scriptdev. (Disable it to speedup build + in dev mode by not including scripts) + + DEV_BINARY_DIR Target directory for executables on Windows only + To set an option simply type -D