This repository was archived by the owner on Apr 2, 2025. It is now read-only.
Fix database reconnection crash #264
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- name: Install Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install build prerequisites | |
run: sudo apt-get install gcc perl ninja-build cmake | |
- name: Install conan | |
run: pip3 install conan | |
- name: Configure project | |
run: | | |
conan profile detect | |
conan install . --output-folder=Build --build=missing -s build_type=Release | |
cmake -S . -B Build -G Ninja \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_TOOLCHAIN_FILE=Build/conan_toolchain.cmake \ | |
-DCONFIG_BUILD_TARGET_AUCTION_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_BREAKLEE=OFF \ | |
-DCONFIG_BUILD_TARGET_CHAT_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_LOGIN_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_MASTER_DBAGENT=ON \ | |
-DCONFIG_BUILD_TARGET_MASTER_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_PARTY_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_WORLD_SVR=ON | |
- name: Build project | |
run: cmake --build Build --config Release | |
- name: Prepare to upload binaries | |
run: | | |
mkdir bin | |
cp ./Build/AuctionSvr bin | |
cp ./Build/ChatSvr bin | |
cp ./Build/LoginSvr bin | |
cp ./Build/MasterSvr bin | |
cp ./Build/MasterDBAgent bin | |
cp ./Build/PartySvr bin | |
cp ./Build/WorldSvr bin | |
chmod +x bin/* | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: breaklee-ubuntu-latest | |
path: bin | |
- name: Construct artifact URL | |
run: echo "ARTIFACT_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" >> $GITHUB_ENV | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- name: Install Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install build prerequisites | |
run: brew install python3 openssl mariadb zlib ninja cmake | |
- name: Install conan | |
run: | | |
pip3 install conan --break-system-packages | |
export PATH="$HOME/.local/bin:$PATH" | |
- name: Configure project | |
run: | | |
conan profile detect | |
conan install . --output-folder=Build --build=missing -s build_type=Release | |
cmake -S . -B Build -G Ninja \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_TOOLCHAIN_FILE=Build/conan_toolchain.cmake \ | |
-DCONFIG_BUILD_TARGET_AUCTION_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_BREAKLEE=OFF \ | |
-DCONFIG_BUILD_TARGET_CHAT_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_LOGIN_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_MASTER_DBAGENT=ON \ | |
-DCONFIG_BUILD_TARGET_MASTER_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_PARTY_SVR=ON \ | |
-DCONFIG_BUILD_TARGET_WORLD_SVR=ON | |
- name: Build project | |
run: cmake --build Build --config Release | |
- name: Prepare to upload binaries (macOS) | |
run: | | |
mkdir bin | |
cp ./Build/AuctionSvr bin | |
cp ./Build/ChatSvr bin | |
cp ./Build/LoginSvr bin | |
cp ./Build/MasterSvr bin | |
cp ./Build/MasterDBAgent bin | |
cp ./Build/PartySvr bin | |
cp ./Build/WorldSvr bin | |
chmod +x bin/* | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: breaklee-macos-latest | |
path: bin | |
- name: Construct artifact URL | |
run: echo "ARTIFACT_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" >> $GITHUB_ENV | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- name: Install Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install conan | |
run: pip3 install conan | |
- name: Configure project | |
run: | | |
conan profile detect | |
conan install . --output-folder=Build --build=missing -s build_type=Release | |
cmake -S . -B Build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="Build\conan_toolchain.cmake" -DCONFIG_BUILD_TARGET_AUCTION_SVR=ON -DCONFIG_BUILD_TARGET_BREAKLEE=OFF -DCONFIG_BUILD_TARGET_CHAT_SVR=ON -DCONFIG_BUILD_TARGET_LOGIN_SVR=ON -DCONFIG_BUILD_TARGET_MASTER_DBAGENT=ON -DCONFIG_BUILD_TARGET_MASTER_SVR=ON -DCONFIG_BUILD_TARGET_PARTY_SVR=ON -DCONFIG_BUILD_TARGET_WORLD_SVR=ON | |
- name: Build project | |
run: cmake --build Build --config Release | |
- name: Prepare to upload binaries | |
run: | | |
New-Item -ItemType Directory -Force -Path bin | |
Copy-Item ./Build/Release/AuctionSvr.exe bin | |
Copy-Item ./Build/Release/ChatSvr.exe bin | |
Copy-Item ./Build/Release/LoginSvr.exe bin | |
Copy-Item ./Build/Release/MasterDBAgent.exe bin | |
Copy-Item ./Build/Release/MasterSvr.exe bin | |
Copy-Item ./Build/Release/PartySvr.exe bin | |
Copy-Item ./Build/Release/WorldSvr.exe bin | |
shell: powershell | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: breaklee-windows-latest | |
path: bin | |
- name: Construct artifact URL | |
run: echo "ARTIFACT_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" >> $GITHUB_ENV | |
notify-discord-ubuntu: | |
needs: build-ubuntu | |
if: success() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- name: Get commit message | |
id: get_commit_message | |
run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: breaklee-ubuntu-latest | |
path: downloaded_bin | |
- name: Send Notification to Discord with Artifact Upload | |
run: | | |
cd downloaded_bin | |
zip -r artifacts.zip . | |
curl -H "Content-Type: multipart/form-data" \ | |
-F "payload_json={\"content\": \"Build for commit \`${{ github.sha }}\` **ubuntu-latest** completed successfully! Commit message: \`${{ env.COMMIT_MESSAGE }}\`.\"}" \ | |
-F "[email protected]" \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} | |
shell: bash | |
notify-discord-macos: | |
needs: build-macos | |
if: success() | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- name: Get commit message | |
id: get_commit_message | |
run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: breaklee-macos-latest | |
path: downloaded_bin | |
- name: Send Notification to Discord with Artifact Upload | |
run: | | |
cd downloaded_bin | |
zip -r artifacts.zip . | |
curl -H "Content-Type: multipart/form-data" \ | |
-F "payload_json={\"content\": \"Build for commit \`${{ github.sha }}\` **macos-latest** completed successfully! Commit message: \`${{ env.COMMIT_MESSAGE }}\`. \"}" \ | |
-F "[email protected]" \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} | |
shell: bash | |
notify-discord-windows: | |
needs: build-windows | |
if: success() | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- name: Get commit message | |
id: get_commit_message | |
run: echo "::set-output name=commit_message::$(git log -1 --pretty=format:'%s')" | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
with: | |
name: breaklee-windows-latest | |
path: downloaded_bin | |
- name: Send Notification to Discord with Artifact Upload | |
run: | | |
cd downloaded_bin | |
choco install zip | |
zip -r artifacts.zip . | |
curl -H "Content-Type: multipart/form-data" \ | |
-F "payload_json={\"content\": \"Build for commit \`${{ github.sha }}\` **windows-latest** completed successfully! Commit message: \`${{ steps.get_commit_message.outputs.commit_message }}\`.\"}" \ | |
-F "[email protected]" \ | |
${{ secrets.DISCORD_WEBHOOK_URL }} | |
shell: bash |