Skip to content

Commit

Permalink
Update GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed May 19, 2024
1 parent 6c03114 commit 07406eb
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 92 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOs build
name: macOS Build

on: [push]

Expand All @@ -21,19 +21,19 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{env.REPO_DIR}}
submodules: true

- name: Install dependencies
- 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/[email protected].1
- name: Install Boost
uses: MarkusJx/[email protected].5
id: install-boost
with:
# REQUIRED: Specify the required boost version
Expand All @@ -60,31 +60,29 @@ jobs:
notify:
permissions:
contents: none
name: Discord Notification
runs-on: ubuntu-20.04
name: Send Notification to Discord on Failure
runs-on: ubuntu-22.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
30 changes: 15 additions & 15 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
BUILD_TYPE: Release
REPO_DIR : ${{github.workspace}}
BUILD_DIR: ${{github.workspace}}/bin/builddir
BOOST_VERSION: "1.79.0"
BOOST_VERSION: "1.83.0"
BOOST_PLATFORM_VERSION: "22.04"

jobs:
Expand All @@ -29,7 +29,7 @@ jobs:
COMPILER_CC: clang
COMPILER_PP: clang++
USE_PCH: ON
EXTRA_BUILD: "-DBUILD_AHBOT=ON -DBUILD_PLAYERBOT=ON "
EXTRA_BUILD: "-DBUILD_EXTRACTORS=ON -DBUILD_AHBOT=ON -DBUILD_PLAYERBOT=ON "

- os: ubuntu-22.04
COMPILER_CC: clang
Expand All @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{env.REPO_DIR}}
submodules: true
Expand All @@ -52,8 +52,8 @@ jobs:
echo "CXX=${{matrix.COMPILER_PP}}" >> $GITHUB_ENV
cmake -E make_directory ${{ env.BUILD_DIR }}
- name: Install boost
uses: MarkusJx/[email protected].1
- name: Install Boost
uses: MarkusJx/[email protected].5
id: install-boost
with:
# REQUIRED: Specify the required boost version
Expand All @@ -74,15 +74,17 @@ jobs:
USE_PCH: ${{ matrix.USE_PCH }}
EXTRA_BUILD: ${{ matrix.EXTRA_BUILD }}
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: cmake -DBUILD_ELUNA=ON -DBoost_ARCHITECTURE=-x64 -DPCH=${{env.USE_PCH}} ${{env.EXTRA_BUILD}}-B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}}
run: cmake -DBUILD_ELUNA=ON -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
name: Send Notification to Discord on Failure
runs-on: ubuntu-22.04
permissions:
contents: none
Expand All @@ -91,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
92 changes: 47 additions & 45 deletions .github/workflows/windows-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows release build
name: Windows Release Build

#
on:
Expand All @@ -12,7 +12,7 @@ env:
REPO_DIR : ${{github.workspace}}
BUILD_DIR: ${{github.workspace}}/bin/builddir
BOOST_TOOLSET: "msvc"
BOOST_VERSION: "1.79.0"
BOOST_VERSION: "1.83.0"
BOOST_PLATFORM_VERSION: "2022"

jobs:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{env.REPO_DIR}}
submodules: true
Expand All @@ -53,8 +53,8 @@ jobs:
cmake -E make_directory ${{ env.BUILD_DIR }}
# install dependencies
- name: Install boost
uses: MarkusJx/[email protected].1
- name: Install Boost
uses: MarkusJx/[email protected].5
id: install-boost
with:
# REQUIRED: Specify the required boost version
Expand Down Expand Up @@ -82,8 +82,9 @@ jobs:
run: |
cd ${{env.BUILD_DIR}}/bin
7z a -tzip ${{env.ARCHIVE_FILENAME}} "x64_${{env.BUILD_TYPE}}"
- name: Archive this artefact
uses: actions/upload-artifact@v3
- name: Archive The Artifact
uses: actions/upload-artifact@v4
with:
name: snapshot-${{matrix.TYPE}}
path: "${{env.BUILD_DIR}}/bin/${{env.ARCHIVE_FILENAME}}"
Expand All @@ -95,90 +96,93 @@ jobs:
needs: build

steps:
- name: Download artifact snapshot-default
uses: actions/download-artifact@v3
- 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@v3
- name: Download Artifact snapshot-with-all
uses: actions/download-artifact@v4
with:
name: snapshot-with-all
path: all_snapshots
- name: Download artifact snapshot-with-eluna-playerbot-ahbot
uses: actions/download-artifact@v3
- name: Download Artifact snapshot-with-eluna-playerbot-ahbot
uses: actions/download-artifact@v4
with:
name: snapshot-with-eluna-playerbot-ahbot
path: all_snapshots
- name: Download artifact snapshot-with-eluna-playerbot
uses: actions/download-artifact@v3
- name: Download Artifact snapshot-with-eluna-playerbot
uses: actions/download-artifact@v4
with:
name: snapshot-with-eluna-playerbot
path: all_snapshots
- name: Download artifact snapshot-with-eluna-ahbot
uses: actions/download-artifact@v3
- name: Download Artifact snapshot-with-eluna-ahbot
uses: actions/download-artifact@v4
with:
name: snapshot-with-eluna-ahbot
path: all_snapshots

- name: Get current date
- name: Get Current Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
uses: Kaven-Universe/github-action-current-date-time@v1
with:
format: "YYYY-MM-DD"

- name: Upload snapshot
- name: Upload Snapshot
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Development Build(${{ steps.date.outputs.date }})"
title: "Development Build(${{ steps.date.outputs.time }})"
files: all_snapshots

notify-success:
name: Discord release successfully notification
runs-on: ubuntu-20.04
name: Send Notification to Discord on Success
runs-on: ubuntu-22.04
permissions:
contents: none
needs:
- 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
echo "PB_ARCH_NAME=${projectNames}-with-playerbot-${shortSHA}.zip" >> $GITHUB_ENV
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}})
- [PlayerBot Enabled](${{github.server_url}}/${{ github.repository }}/releases/download/latest/${{env.PB_ARCH_NAME}})
- [AHBot & PlayerBot 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
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
Expand All @@ -192,18 +196,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
Loading

0 comments on commit 07406eb

Please sign in to comment.