From f12f9f4376c4415e6e07b2a0135592708c603b4b Mon Sep 17 00:00:00 2001 From: Cyberium Date: Tue, 5 Mar 2024 17:41:55 +0100 Subject: [PATCH] Update Actions to trigger on each push and remove release version --- .../cmangos-classic-ubuntu-build.yml | 157 -------------- .../cmangos-classic-windows-release.yml | 201 ------------------ .github/workflows/cmangos-classis-manual.yml | 201 ------------------ .github/workflows/cmangos-macos-build.yml | 97 +++++++++ .github/workflows/cmangos-tbc-manual.yml | 201 ------------------ .../workflows/cmangos-tbc-ubuntu-build.yml | 157 -------------- .../workflows/cmangos-tbc-windows-release.yml | 195 ----------------- .github/workflows/cmangos-ubuntu-build.yml | 102 +++++++++ .github/workflows/cmangos-windows-build.yml | 106 +++++++++ .../cmangos-wotlk-windows-release.yml | 195 ----------------- 10 files changed, 305 insertions(+), 1307 deletions(-) delete mode 100644 .github/workflows/cmangos-classic-ubuntu-build.yml delete mode 100644 .github/workflows/cmangos-classic-windows-release.yml delete mode 100644 .github/workflows/cmangos-classis-manual.yml create mode 100644 .github/workflows/cmangos-macos-build.yml delete mode 100644 .github/workflows/cmangos-tbc-manual.yml delete mode 100644 .github/workflows/cmangos-tbc-ubuntu-build.yml delete mode 100644 .github/workflows/cmangos-tbc-windows-release.yml create mode 100644 .github/workflows/cmangos-ubuntu-build.yml create mode 100644 .github/workflows/cmangos-windows-build.yml delete mode 100644 .github/workflows/cmangos-wotlk-windows-release.yml diff --git a/.github/workflows/cmangos-classic-ubuntu-build.yml b/.github/workflows/cmangos-classic-ubuntu-build.yml deleted file mode 100644 index a9ab473bd..000000000 --- a/.github/workflows/cmangos-classic-ubuntu-build.yml +++ /dev/null @@ -1,157 +0,0 @@ -name: CMaNGOS Classic Ubuntu Build - -# use manual run -#on: [workflow_dispatch] - -# use schedule -on: - schedule: - # every day at 6am - - cron: '15 6 * * *' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Debug - CORE_TYPE: "cmangos" - CORE_EXPANSION: "classic" - CORE_BRANCH: "ike3-bots" - BOTS_BRANCH: "master" - CORE_REPO_OWNER: ${{github.repository_owner}} - 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" - -jobs: - build: - runs-on: ${{ matrix.os }} - permissions: - contents: read - - strategy: - matrix: - include: - - os: ubuntu-20.04 - COMPILER_CC: gcc - COMPILER_PP: g++ - USE_PCH: ON - EXTRA_BUILD: "-DBUILD_LOGIN_SERVER=OFF -DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON" - - - os: ubuntu-20.04 - COMPILER_CC: clang - COMPILER_PP: clang++ - USE_PCH: ON - EXTRA_BUILD: "-DBUILD_LOGIN_SERVER=OFF -DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON" - - #- os: ubuntu-20.04 - # COMPILER_CC: clang - # COMPILER_PP: clang++ - # USE_PCH: OFF - # EXTRA_BUILD: "" - - steps: - - name: Checkout Core - uses: actions/checkout@v2 - with: - repository: ${{env.CORE_REPO_OWNER}}/mangos-classic - ref: ${{env.CORE_BRANCH}} - path: ${{env.REPO_DIR}} - - - name: Checkout Bots - uses: actions/checkout@v2 - with: - ref: ${{env.BOTS_BRANCH}} - repository: ${{env.CORE_REPO_OWNER}}/mangosbot-bots - path: "${{env.REPO_DIR}}/src/modules/Bots" - - - name: Create Build Environment - run: | - echo "GITHUB_SHORT_REV=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "ARCHIVE_FILENAME=${{ github.event.repository.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV - echo "CC=${{matrix.COMPILER_CC}}" >> $GITHUB_ENV - echo "CXX=${{matrix.COMPILER_PP}}" >> $GITHUB_ENV - cmake -E make_directory ${{ env.BUILD_DIR }} - - - name: Cache boost - uses: actions/cache@v2 - id: cache-boost - with: - path: "${{env.BOOST_INSTALL_DIR}}/boost" - key: ${{ runner.os }}-boost - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 - 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 - 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 - - - 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}} - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - notify-success: - name: Discord release successfully notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: - - build - if: success() - - steps: - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: info - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **Classic Linux build success!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build success - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-success.png - - notify: - name: Discord Notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: # make sure the notification is sent AFTER the jobs you want included have completed - - build - if: failure() - - steps: - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: error - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **Classic Linux build failed!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build fail - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png diff --git a/.github/workflows/cmangos-classic-windows-release.yml b/.github/workflows/cmangos-classic-windows-release.yml deleted file mode 100644 index c261f5dec..000000000 --- a/.github/workflows/cmangos-classic-windows-release.yml +++ /dev/null @@ -1,201 +0,0 @@ -name: CMaNGOS Classic Windows Release - -# use manual run -#on: [workflow_dispatch] - -# use schedule -on: - schedule: - # every day at 6am - - cron: '0 6 * * *' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - CORE_TYPE: "cmangos" - CORE_EXPANSION: "classic" - CORE_BRANCH: "ike3-bots" - BOTS_BRANCH: "master" - CORE_REPO_OWNER: ${{github.repository_owner}} - BUILD_TYPE: RelWithDebInfo - BUILD_OPTIONS: "-DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON -DBUILD_ACHIEVEMENTS=ON -DBUILD_GIT_ID=ON" - REPO_DIR : ${{github.workspace}} - BUILD_DIR: ${{github.workspace}}/bin/builddir - BOOST_TOOLSET: "msvc" - BOOST_VERSION: "1.78.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" - ARCHIVE_FILENAME: "cmangos-classic.zip" - -jobs: - build: - runs-on: windows-2022 - permissions: - contents: read - - steps: - - name: Checkout CMaNGOS Classic - uses: actions/checkout@v2 - with: - ref: ${{env.CORE_BRANCH}} - repository: ${{env.CORE_REPO_OWNER}}/mangos-classic - path: ${{env.REPO_DIR}} - # submodules: recursive - - - name: Checkout Bots - uses: actions/checkout@v2 - with: - ref: ${{env.BOTS_BRANCH}} - path: "${{env.REPO_DIR}}/src/modules/Bots" - - - uses: FranzDiebold/github-env-vars-action@v2 - - name: Create Build Environment - run: | - 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 }}-boost - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 - 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 - boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a toolset on windows - 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" - run: cmake ${{env.BUILD_OPTIONS}} -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - - name: Archive files - run: | - cd ${{env.BUILD_DIR}}/bin - 7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}\*" - - - name: Archive this artefact - uses: actions/upload-artifact@v2 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" - - upload: - runs-on: ubuntu-20.04 - permissions: - contents: write # for marvinpinto/action-automatic-releases to generate pre-release - needs: build - - steps: - #- name: Download artifact snapshot-default - # uses: actions/download-artifact@v1 - # with: - # name: snapshot-default - # path: all_snapshots - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: all_snapshots - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - #- name: Upload binaries to release - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.GITHUB_TOKEN }} - # file: all_snapshots/cmangos-classic.zip - - #- name: Upload release - # uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "r-${{ steps.date.outputs.date }}" - # prerelease: false - # title: "Windows Build (${{ steps.date.outputs.date }})" - # files: all_snapshots - - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - release_name: "Windows Build (${{ steps.date.outputs.date }})" - tag: "r-${{ steps.date.outputs.date }}" - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: all_snapshots/${{env.ARCHIVE_FILENAME}} - overwrite: true - - notify-success: - name: Discord release successfully notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: - - upload - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Get previous date - id: dateprev - run: echo "::set-output name=date::$(date --date='1 day ago' +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: info - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **Classic Dev Build ${{ steps.date.outputs.date }}!** - details: | - [**Changelog**](${{github.server_url}}/${{ github.repository }}/compare/r-${{ steps.dateprev.outputs.date }}...r-${{ steps.date.outputs.date }}) - [**All Releases**](${{github.server_url}}/${{ github.repository }}/tags) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - [**Download Windows Binaries**](${{github.server_url}}/${{ github.repository }}/releases/download/r-${{ steps.date.outputs.date }}/${{env.ARCHIVE_FILENAME}}) - footer: Build success - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-success.png - - notify: - name: Discord Notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: # make sure the notification is sent AFTER the jobs you want included have completed - - build - if: failure() - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: error - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **Classic Dev Build failed!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build fail - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png diff --git a/.github/workflows/cmangos-classis-manual.yml b/.github/workflows/cmangos-classis-manual.yml deleted file mode 100644 index f8503a092..000000000 --- a/.github/workflows/cmangos-classis-manual.yml +++ /dev/null @@ -1,201 +0,0 @@ -name: CMaNGOS Classic Manual Release - -# use manual run -on: [workflow_dispatch] - -# use schedule -#on: -# schedule: -# # every day at 6am -# - cron: '0 6 * * *' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - CORE_TYPE: "cmangos" - CORE_EXPANSION: "classic" - CORE_BRANCH: "ike3-bots" - BOTS_BRANCH: "master" - CORE_REPO_OWNER: ${{github.repository_owner}} - BUILD_TYPE: RelWithDebInfo - BUILD_OPTIONS: "-DBUILD_EXTRACTORS=ON -DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON -DBUILD_ACHIEVEMENTS=ON -DBUILD_GIT_ID=ON" - REPO_DIR : ${{github.workspace}} - BUILD_DIR: ${{github.workspace}}/bin/builddir - BOOST_TOOLSET: "msvc" - BOOST_VERSION: "1.78.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" - ARCHIVE_FILENAME: "cmangos-classic.zip" - -jobs: - build: - runs-on: windows-2022 - permissions: - contents: read - - steps: - - name: Checkout CMaNGOS Classic - uses: actions/checkout@v2 - with: - ref: ${{env.CORE_BRANCH}} - repository: ${{env.CORE_REPO_OWNER}}/mangos-classic - path: ${{env.REPO_DIR}} - # submodules: recursive - - - name: Checkout Bots - uses: actions/checkout@v2 - with: - ref: ${{env.BOTS_BRANCH}} - path: "${{env.REPO_DIR}}/src/modules/Bots" - - - uses: FranzDiebold/github-env-vars-action@v2 - - name: Create Build Environment - run: | - 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 }}-boost - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 - 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 - boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a toolset on windows - 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" - run: cmake ${{env.BUILD_OPTIONS}} -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - - name: Archive files - run: | - cd ${{env.BUILD_DIR}}/bin - 7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}\*" - - - name: Archive this artefact - uses: actions/upload-artifact@v2 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" - - upload: - runs-on: ubuntu-20.04 - permissions: - contents: write # for marvinpinto/action-automatic-releases to generate pre-release - needs: build - - steps: - #- name: Download artifact snapshot-default - # uses: actions/download-artifact@v1 - # with: - # name: snapshot-default - # path: all_snapshots - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: all_snapshots - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - #- name: Upload binaries to release - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.GITHUB_TOKEN }} - # file: all_snapshots/cmangos-classic.zip - - #- name: Upload release - # uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "r-${{ steps.date.outputs.date }}" - # prerelease: false - # title: "Windows Build (${{ steps.date.outputs.date }})" - # files: all_snapshots - - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - release_name: "Windows Build (${{ steps.date.outputs.date }})" - tag: "r-${{ steps.date.outputs.date }}" - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: all_snapshots/${{env.ARCHIVE_FILENAME}} - overwrite: true - - notify-success: - name: Discord release successfully notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: - - upload - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Get previous date - id: dateprev - run: echo "::set-output name=date::$(date --date='1 day ago' +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: info - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **Classic Dev Build ${{ steps.date.outputs.date }}!** - details: | - [**Changelog**](${{github.server_url}}/${{ github.repository }}/compare/r-${{ steps.dateprev.outputs.date }}...r-${{ steps.date.outputs.date }}) - [**All Releases**](${{github.server_url}}/${{ github.repository }}/tags) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - [**Download Windows Binaries**](${{github.server_url}}/${{ github.repository }}/releases/download/r-${{ steps.date.outputs.date }}/${{env.ARCHIVE_FILENAME}}) - footer: Build success - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-success.png - - notify: - name: Discord Notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: # make sure the notification is sent AFTER the jobs you want included have completed - - build - if: failure() - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: error - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **Classic Dev Build failed!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build fail - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png diff --git a/.github/workflows/cmangos-macos-build.yml b/.github/workflows/cmangos-macos-build.yml new file mode 100644 index 000000000..602b0202c --- /dev/null +++ b/.github/workflows/cmangos-macos-build.yml @@ -0,0 +1,97 @@ +name: macOS Build + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + REPO_DIR : ${{github.workspace}} + BUILD_DIR: ${{github.workspace}}/bin/builddir + BOOST_VERSION: "1.83.0" + BOOST_PLATFORM_VERSION: "11" + CORE_REPO_OWNER: ${{github.repository_owner}} + +permissions: + contents: read + +jobs: + build: + runs-on: ${{ matrix.os }} + permissions: + contents: read + + strategy: + matrix: + include: + - os: macos-11 + EXTRA_BUILD: "-DBUILD_PLAYERBOTS=ON" + CORE_PATH : ${{github.repository_owner}}/mangos-classic + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{matrix.CORE_PATH}} + ref: master + path: ${{env.REPO_DIR}} + + - name: Install Dependencies + run: | + brew install mysql-client + brew install openssl + echo "OPENSSL_ROOT_DIR=$(brew --prefix --installed openssl)" >> $GITHUB_ENV + + - 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/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 toolset + toolset: clang + # NOTE: If a boost version matching all requirements cannot be found, + # this build step will fail + + - name: Configure + env: + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} + run: cmake -DBoost_ARCHITECTURE=-x64 ${{matrix.EXTRA_BUILD}} -DCMAKE_INSTALL_PREFIX=/home/runner/work -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} + + - name: Build + env: + MAKEFLAGS: "-j8" + run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} + + notify: + permissions: + contents: none + 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: 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.1.1 + with: + severity: error + description: | + **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: CMaNGOS Developers Notified! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/cmangos-tbc-manual.yml b/.github/workflows/cmangos-tbc-manual.yml deleted file mode 100644 index d8fdb7e5c..000000000 --- a/.github/workflows/cmangos-tbc-manual.yml +++ /dev/null @@ -1,201 +0,0 @@ -name: CMaNGOS TBC Manual Release - -# use manual run -on: [workflow_dispatch] - -# use schedule -#on: -# schedule: -# # every day at 6am -# - cron: '0 6 * * *' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - CORE_TYPE: "cmangos" - CORE_EXPANSION: "tbc" - CORE_BRANCH: "ike3-bots" - BOTS_BRANCH: "master" - CORE_REPO_OWNER: ${{github.repository_owner}} - BUILD_TYPE: RelWithDebInfo - BUILD_OPTIONS: "-DBUILD_EXTRACTORS=OFF -DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON -DBUILD_GIT_ID=ON" - REPO_DIR : ${{github.workspace}} - BUILD_DIR: ${{github.workspace}}/bin/builddir - BOOST_TOOLSET: "msvc" - BOOST_VERSION: "1.78.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" - ARCHIVE_FILENAME: "cmangos-tbc.zip" - -jobs: - build: - runs-on: windows-2022 - permissions: - contents: read - - steps: - - name: Checkout CMaNGOS TBC - uses: actions/checkout@v2 - with: - ref: ${{env.CORE_BRANCH}} - repository: ${{env.CORE_REPO_OWNER}}/mangos-tbc - path: ${{env.REPO_DIR}} - # submodules: recursive - - - name: Checkout Bots - uses: actions/checkout@v2 - with: - ref: ${{env.BOTS_BRANCH}} - path: "${{env.REPO_DIR}}/src/modules/Bots" - - - uses: FranzDiebold/github-env-vars-action@v2 - - name: Create Build Environment - run: | - 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 }}-boost - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 - 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 - boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a toolset on windows - 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" - run: cmake ${{env.BUILD_OPTIONS}} -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - - name: Archive files - run: | - cd ${{env.BUILD_DIR}}/bin - 7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}\*" - - - name: Archive this artefact - uses: actions/upload-artifact@v2 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" - - upload: - runs-on: ubuntu-20.04 - permissions: - contents: write # for marvinpinto/action-automatic-releases to generate pre-release - needs: build - - steps: - #- name: Download artifact snapshot-default - # uses: actions/download-artifact@v1 - # with: - # name: snapshot-default - # path: all_snapshots - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: all_snapshots - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - #- name: Upload binaries to release - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.GITHUB_TOKEN }} - # file: all_snapshots/cmangos-classic.zip - - #- name: Upload release - # uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "r-${{ steps.date.outputs.date }}" - # prerelease: false - # title: "Windows Build (${{ steps.date.outputs.date }})" - # files: all_snapshots - - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - release_name: "Windows Build (${{ steps.date.outputs.date }})" - tag: "r-${{ steps.date.outputs.date }}" - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: all_snapshots/${{env.ARCHIVE_FILENAME}} - overwrite: true - - notify-success: - name: Discord release successfully notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: - - upload - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Get previous date - id: dateprev - run: echo "::set-output name=date::$(date --date='1 day ago' +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: info - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **TBC Dev Build ${{ steps.date.outputs.date }}!** - details: | - [**Changelog**](${{github.server_url}}/${{ github.repository }}/compare/r-${{ steps.dateprev.outputs.date }}...r-${{ steps.date.outputs.date }}) - [**All Releases**](${{github.server_url}}/${{ github.repository }}/tags) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - [**Download Windows Binaries**](${{github.server_url}}/${{ github.repository }}/releases/download/r-${{ steps.date.outputs.date }}/${{env.ARCHIVE_FILENAME}}) - footer: Build success - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-success.png - - notify: - name: Discord Notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: # make sure the notification is sent AFTER the jobs you want included have completed - - build - if: failure() - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: error - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **TBC Dev Build failed!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build fail - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png diff --git a/.github/workflows/cmangos-tbc-ubuntu-build.yml b/.github/workflows/cmangos-tbc-ubuntu-build.yml deleted file mode 100644 index e83dceaf6..000000000 --- a/.github/workflows/cmangos-tbc-ubuntu-build.yml +++ /dev/null @@ -1,157 +0,0 @@ -name: CMaNGOS TBC Ubuntu Build - -# use manual run -#on: [workflow_dispatch] - -# use schedule -on: - schedule: - # every day at 6am - - cron: '20 6 * * *' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Debug - CORE_TYPE: "cmangos" - CORE_EXPANSION: "tbc" - CORE_BRANCH: "ike3-bots" - BOTS_BRANCH: "master" - CORE_REPO_OWNER: ${{github.repository_owner}} - 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" - -jobs: - build: - runs-on: ${{ matrix.os }} - permissions: - contents: read - - strategy: - matrix: - include: - - os: ubuntu-20.04 - COMPILER_CC: gcc - COMPILER_PP: g++ - USE_PCH: ON - EXTRA_BUILD: "-DBUILD_LOGIN_SERVER=OFF -DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON" - - - os: ubuntu-20.04 - COMPILER_CC: clang - COMPILER_PP: clang++ - USE_PCH: ON - EXTRA_BUILD: "-DBUILD_LOGIN_SERVER=OFF -DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON" - - #- os: ubuntu-20.04 - # COMPILER_CC: clang - # COMPILER_PP: clang++ - # USE_PCH: OFF - # EXTRA_BUILD: "" - - steps: - - name: Checkout Core - uses: actions/checkout@v2 - with: - repository: ${{env.CORE_REPO_OWNER}}/mangos-${{env.CORE_EXPANSION}} - ref: ${{env.CORE_BRANCH}} - path: ${{env.REPO_DIR}} - - - name: Checkout Bots - uses: actions/checkout@v2 - with: - ref: ${{env.BOTS_BRANCH}} - repository: ${{env.CORE_REPO_OWNER}}/mangosbot-bots - path: "${{env.REPO_DIR}}/src/modules/Bots" - - - name: Create Build Environment - run: | - echo "GITHUB_SHORT_REV=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "ARCHIVE_FILENAME=${{ github.event.repository.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV - echo "CC=${{matrix.COMPILER_CC}}" >> $GITHUB_ENV - echo "CXX=${{matrix.COMPILER_PP}}" >> $GITHUB_ENV - cmake -E make_directory ${{ env.BUILD_DIR }} - - - name: Cache boost - uses: actions/cache@v2 - id: cache-boost - with: - path: "${{env.BOOST_INSTALL_DIR}}/boost" - key: ${{ runner.os }}-boost - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 - 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 - 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 - - - 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}} - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - notify-success: - name: Discord release successfully notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: - - build - if: success() - - steps: - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: info - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **TBC Linux build success!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build success - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-success.png - - notify: - name: Discord Notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: # make sure the notification is sent AFTER the jobs you want included have completed - - build - if: failure() - - steps: - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: error - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **TBC Linux build failed!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build fail - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png diff --git a/.github/workflows/cmangos-tbc-windows-release.yml b/.github/workflows/cmangos-tbc-windows-release.yml deleted file mode 100644 index 86a0500b0..000000000 --- a/.github/workflows/cmangos-tbc-windows-release.yml +++ /dev/null @@ -1,195 +0,0 @@ -name: CMaNGOS TBC Windows Release - -# use manual run -#on: [workflow_dispatch] - -# use schedule -on: - schedule: - # every day at 6am - - cron: '5 6 * * *' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - CORE_TYPE: "cmangos" - CORE_EXPANSION: "tbc" - CORE_BRANCH: "ike3-bots" - BOTS_BRANCH: "master" - CORE_REPO_OWNER: ${{github.repository_owner}} - BUILD_TYPE: RelWithDebInfo - BUILD_OPTIONS: "-DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON -DBUILD_GIT_ID=ON" - REPO_DIR : ${{github.workspace}} - BUILD_DIR: ${{github.workspace}}/bin/builddir - BOOST_TOOLSET: "msvc" - BOOST_VERSION: "1.78.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" - ARCHIVE_FILENAME: "cmangos-tbc.zip" - -jobs: - build: - runs-on: windows-2022 - permissions: - contents: read - - steps: - - name: Checkout CMaNGOS TBC - uses: actions/checkout@v2 - with: - ref: ${{env.CORE_BRANCH}} - repository: ${{env.CORE_REPO_OWNER}}/mangos-tbc - path: ${{env.REPO_DIR}} - # submodules: recursive - - - name: Checkout Bots - uses: actions/checkout@v2 - with: - ref: ${{env.BOTS_BRANCH}} - path: "${{env.REPO_DIR}}/src/modules/Bots" - - - uses: FranzDiebold/github-env-vars-action@v2 - - name: Create Build Environment - run: | - 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 }}-boost - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 - 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 - boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a toolset on windows - 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" - run: cmake ${{env.BUILD_OPTIONS}} -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - - name: Archive files - run: | - cd ${{env.BUILD_DIR}}/bin - 7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}\*" - - - name: Archive this artefact - uses: actions/upload-artifact@v2 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" - - upload: - runs-on: ubuntu-20.04 - permissions: - contents: write # for marvinpinto/action-automatic-releases to generate pre-release - needs: build - - steps: - #- name: Download artifact snapshot-default - # uses: actions/download-artifact@v1 - # with: - # name: snapshot-default - # path: all_snapshots - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: all_snapshots - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - release_name: "Windows Build (${{ steps.date.outputs.date }})" - tag: "r-${{ steps.date.outputs.date }}" - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: all_snapshots/${{env.ARCHIVE_FILENAME}} - overwrite: true - - #- name: Upload release - # uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "r-${{ steps.date.outputs.date }}" - # prerelease: false - # title: "Windows Build (${{ steps.date.outputs.date }})" - # files: all_snapshots - - notify-success: - name: Discord release successfully notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: - - upload - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Get previous date - id: dateprev - run: echo "::set-output name=date::$(date --date='1 day ago' +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: info - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **TBC Dev Build ${{ steps.date.outputs.date }}!** - details: | - [**Changelog**](${{github.server_url}}/${{ github.repository }}/compare/r-${{ steps.dateprev.outputs.date }}...r-${{ steps.date.outputs.date }}) - [**All Releases**](${{github.server_url}}/${{ github.repository }}/tags) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - [**Download Windows Binaries**](${{github.server_url}}/${{ github.repository }}/releases/download/r-${{ steps.date.outputs.date }}/${{env.ARCHIVE_FILENAME}}) - footer: Build success - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-success.png - - notify: - name: Discord Notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: # make sure the notification is sent AFTER the jobs you want included have completed - - build - if: failure() - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: error - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **TBC Dev Build failed!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build fail - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png diff --git a/.github/workflows/cmangos-ubuntu-build.yml b/.github/workflows/cmangos-ubuntu-build.yml new file mode 100644 index 000000000..979fa24ed --- /dev/null +++ b/.github/workflows/cmangos-ubuntu-build.yml @@ -0,0 +1,102 @@ +name: Ubuntu Build + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + REPO_DIR : ${{github.workspace}} + BUILD_DIR: ${{github.workspace}}/bin/builddir + BOOST_VERSION: "1.83.0" + BOOST_PLATFORM_VERSION: "22.04" + COMPILER_CC: clang + COMPILER_PP: clang++ + CORE_REPO_OWNER: ${{github.repository_owner}} + +jobs: + build: + runs-on: ${{ matrix.os }} + permissions: + contents: read + + strategy: + matrix: + include: + - os: ubuntu-22.04 + EXTRA_BUILD: "-DBUILD_PLAYERBOTS=ON" + CORE_PATH : ${{github.repository_owner}}/mangos-classic + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{matrix.CORE_PATH}} + ref: master + path: ${{env.REPO_DIR}} + + - name: Create Build Environment + run: | + echo "GITHUB_SHORT_REV=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "ARCHIVE_FILENAME=${{ github.event.repository.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV + echo "CC=${{env.COMPILER_CC}}" >> $GITHUB_ENV + echo "CXX=${{env.COMPILER_PP}}" >> $GITHUB_ENV + cmake -E make_directory ${{ env.BUILD_DIR }} + + - 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/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 toolset + toolset: gcc + # 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: + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} + run: cmake -DBoost_ARCHITECTURE=-x64 -DCMAKE_INSTALL_PREFIX=/home/runner/work ${{matrix.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}} + cmake --install ${{env.BUILD_DIR}} + + notify: + 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 + - build + if: failure() + + steps: + - 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.1.1 + with: + severity: error + description: | + **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: CMaNGOS Developers Notified! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/cmangos-windows-build.yml b/.github/workflows/cmangos-windows-build.yml new file mode 100644 index 000000000..1a9bef77c --- /dev/null +++ b/.github/workflows/cmangos-windows-build.yml @@ -0,0 +1,106 @@ +name: Windows Build + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + REPO_DIR : ${{github.workspace}} + BUILD_DIR: ${{github.workspace}}/bin/builddir + BOOST_TOOLSET: "msvc" + BOOST_VERSION: "1.83.0" + BOOST_PLATFORM_VERSION: "2022" + +jobs: + build: + runs-on: ${{ matrix.os }} + permissions: + contents: read + + strategy: + matrix: + include: + - os: windows-2022 + EXTRA_BUILD: "-DBUILD_PLAYERBOTS=ON" + CORE_PATH : ${{github.repository_owner}}/mangos-classic + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{matrix.CORE_PATH}} + ref: master + path: ${{env.REPO_DIR}} + + - name: Create Build Environment + run: | + echo "GITHUB_SHORT_REV=$(git rev-parse --short HEAD)" >> $env:GITHUB_ENV + echo "ARCHIVE_FILENAME=${{ github.event.repository.name }}-$(git rev-parse --short HEAD).zip" >> $env:GITHUB_ENV + cmake -E make_directory ${{ env.BUILD_DIR }} + + # install dependencies + - 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/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 toolset + toolset: ${{env.BOOST_TOOLSET}} + # NOTE: If a boost version matching all requirements cannot be found, + # this build step will fail + + - name: Configure + env: + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} + run: cmake ${{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}} + + - name: Archive Files + run: | + cd ${{env.BUILD_DIR}}/bin + 7z a -tzip ${{env.ARCHIVE_FILENAME}} x64_Release + + - name: Archive The Artifact + uses: actions/upload-artifact@v4 + with: + name: snapshot + path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" + + notify: + name: Send Notification to Discord on Failure + runs-on: ubuntu-20.04 + permissions: + contents: none + needs: # make sure the notification is sent AFTER the jobs you want included have completed + - build + if: failure() + + steps: + - 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.1.1 + with: + severity: error + description: | + **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 Developers Notified! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/cmangos-wotlk-windows-release.yml b/.github/workflows/cmangos-wotlk-windows-release.yml deleted file mode 100644 index ef4bb1d06..000000000 --- a/.github/workflows/cmangos-wotlk-windows-release.yml +++ /dev/null @@ -1,195 +0,0 @@ -name: CMaNGOS WotLK Windows Release - -# use manual run -#on: [workflow_dispatch] - -# use schedule -on: - schedule: - # every day at 6am - - cron: '10 6 * * *' - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - CORE_TYPE: "cmangos" - CORE_EXPANSION: "wotlk" - CORE_BRANCH: "ike3-bots" - BOTS_BRANCH: "master" - CORE_REPO_OWNER: ${{github.repository_owner}} - BUILD_TYPE: RelWithDebInfo - BUILD_OPTIONS: "-DBUILD_IKE3_BOTS=ON -DBUILD_AHBOT=ON -DBUILD_GIT_ID=ON" - REPO_DIR : ${{github.workspace}} - BUILD_DIR: ${{github.workspace}}/bin/builddir - BOOST_TOOLSET: "msvc" - BOOST_VERSION: "1.78.0" - BOOST_INSTALL_DIR: "${{github.workspace}}/bin" - ARCHIVE_FILENAME: "cmangos-wotlk.zip" - -jobs: - build: - runs-on: windows-2022 - permissions: - contents: read - - steps: - - name: Checkout CMaNGOS WotLK - uses: actions/checkout@v2 - with: - ref: ${{env.CORE_BRANCH}} - repository: ${{env.CORE_REPO_OWNER}}/mangos-wotlk - path: ${{env.REPO_DIR}} - # submodules: recursive - - - name: Checkout Bots - uses: actions/checkout@v2 - with: - ref: ${{env.BOTS_BRANCH}} - path: "${{env.REPO_DIR}}/src/modules/Bots" - - - uses: FranzDiebold/github-env-vars-action@v2 - - name: Create Build Environment - run: | - 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 }}-boost - - - if: steps.cache-boost.outputs.cache-hit != 'true' - name: Install boost - uses: MarkusJx/install-boost@v2.3.0 - 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 - boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a toolset on windows - 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" - run: cmake ${{env.BUILD_OPTIONS}} -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} - - - name: Archive files - run: | - cd ${{env.BUILD_DIR}}/bin - 7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}\*" - - - name: Archive this artefact - uses: actions/upload-artifact@v2 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}" - - upload: - runs-on: ubuntu-20.04 - permissions: - contents: write # for marvinpinto/action-automatic-releases to generate pre-release - needs: build - - steps: - #- name: Download artifact snapshot-default - # uses: actions/download-artifact@v1 - # with: - # name: snapshot-default - # path: all_snapshots - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: snapshot-${{env.CORE_EXPANSION}} - path: all_snapshots - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - release_name: "Windows Build (${{ steps.date.outputs.date }})" - tag: "r-${{ steps.date.outputs.date }}" - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: all_snapshots/${{env.ARCHIVE_FILENAME}} - overwrite: true - - #- name: Upload release - # uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "r-${{ steps.date.outputs.date }}" - # prerelease: false - # title: "Windows Build (${{ steps.date.outputs.date }})" - # files: all_snapshots - - notify-success: - name: Discord release successfully notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: - - upload - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Get previous date - id: dateprev - run: echo "::set-output name=date::$(date --date='1 day ago' +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: info - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **WotLK Dev Build ${{ steps.date.outputs.date }}!** - details: | - [**Changelog**](${{github.server_url}}/${{ github.repository }}/compare/r-${{ steps.dateprev.outputs.date }}...r-${{ steps.date.outputs.date }}) - [**All Releases**](${{github.server_url}}/${{ github.repository }}/tags) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - [**Download Windows Binaries**](${{github.server_url}}/${{ github.repository }}/releases/download/r-${{ steps.date.outputs.date }}/${{env.ARCHIVE_FILENAME}}) - footer: Build success - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-success.png - - notify: - name: Discord Notification - runs-on: ubuntu-20.04 - permissions: - contents: none - needs: # make sure the notification is sent AFTER the jobs you want included have completed - - build - if: failure() - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - - name: Notify - uses: rjstone/discord-webhook-notify@v1.0.4 - with: - severity: error - username: ${{env.CORE_TYPE}}-${{env.CORE_EXPANSION}} - description: | - **WotLK Dev Build failed!** - details: | - [**Last commits**](${{github.server_url}}/${{ github.repository }}/commits/${{env.BOTS_BRANCH}}) - [**Build Log**](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) - footer: Build fail - webhookUrl: ${{ secrets.DISCORD_WEBHOOK_BUILD }} - avatarUrl: https://github.githubassets.com/favicons/favicon-failure.png