From 2e8bd9e1eb87893ece02892c4545e1ac3d4334fa Mon Sep 17 00:00:00 2001 From: s1lentq Date: Tue, 16 Mar 2021 00:41:38 +0700 Subject: [PATCH] Add workflows/build.yml Preparing migration to workflows Fixes warnings Update badges README.md --- .github/workflows/build.yml | 183 +++++++++++++++ CMakeLists.txt | 11 + README.md | 7 +- dep/bzip2/CMakeLists.txt | 21 ++ dep/bzip2/msvc/bzip2.vcxproj | 37 --- dep/cppunitlite/msvc/cppunitlite.vcxproj | 37 --- rehlds/CMakeLists.txt | 148 ++++++++++++ rehlds/HLTV/CMakeLists.txt | 8 + rehlds/HLTV/Console/CMakeLists.txt | 100 ++++++++ rehlds/HLTV/Console/msvc/Console.vcxproj | 73 +----- rehlds/HLTV/Console/msvc/PreBuild.bat | 220 ++++++++++++++++++ rehlds/HLTV/Console/src/System.cpp | 71 +++--- rehlds/HLTV/Console/src/System.h | 6 +- rehlds/HLTV/Core/CMakeLists.txt | 121 ++++++++++ rehlds/HLTV/Core/msvc/Core.vcxproj | 74 ------ rehlds/HLTV/Core/src/Delta.cpp | 18 +- rehlds/HLTV/Core/src/World.cpp | 7 +- rehlds/HLTV/DemoPlayer/CMakeLists.txt | 96 ++++++++ .../HLTV/DemoPlayer/msvc/DemoPlayer.vcxproj | 58 ----- rehlds/HLTV/Director/CMakeLists.txt | 103 ++++++++ rehlds/HLTV/Director/msvc/Director.vcxproj | 54 ----- rehlds/HLTV/Proxy/CMakeLists.txt | 126 ++++++++++ rehlds/HLTV/Proxy/msvc/Proxy.vcxproj | 134 ----------- rehlds/HLTV/Proxy/src/Proxy.cpp | 18 +- rehlds/HLTV/common/BitBuffer.cpp | 12 +- rehlds/HLTV/common/DemoFile.cpp | 6 +- rehlds/HLTV/common/InfoString.cpp | 20 +- rehlds/HLTV/common/NetAddress.cpp | 6 +- rehlds/HLTV/common/common.cpp | 4 +- rehlds/common/IBaseSystem.h | 2 +- rehlds/common/TextConsoleUnix.cpp | 6 +- rehlds/common/TextConsoleUnix.h | 6 +- rehlds/common/TextConsoleWin32.cpp | 10 +- rehlds/common/TextConsoleWin32.h | 10 +- rehlds/common/commandline.cpp | 6 +- rehlds/common/stdc++compat.cpp | 2 +- rehlds/common/textconsole.cpp | 4 +- rehlds/common/textconsole.h | 14 +- rehlds/dedicated/CMakeLists.txt | 95 ++++++++ rehlds/dedicated/msvc/dedicated.vcxproj | 70 ------ rehlds/dedicated/src/dedicated_exports.cpp | 4 +- rehlds/dedicated/src/isys.h | 10 +- rehlds/dedicated/src/sys_ded.cpp | 8 +- rehlds/dedicated/src/sys_ded.h | 4 +- rehlds/dedicated/src/sys_linux.cpp | 20 +- rehlds/dedicated/src/sys_window.cpp | 20 +- rehlds/engine/SystemWrapper.cpp | 79 ++++--- rehlds/engine/SystemWrapper.h | 4 +- rehlds/engine/common.cpp | 2 +- rehlds/engine/cvar.cpp | 2 - rehlds/engine/decals.cpp | 10 +- rehlds/engine/delta.cpp | 28 ++- rehlds/engine/filesystem.cpp | 8 +- rehlds/engine/filesystem_.h | 2 +- rehlds/engine/host.cpp | 2 +- rehlds/engine/host_cmd.cpp | 9 +- rehlds/engine/iengine.h | 2 +- rehlds/engine/mathlib_sse.cpp | 8 +- rehlds/engine/model.cpp | 4 +- rehlds/engine/net_chan.cpp | 2 +- rehlds/engine/net_ws.cpp | 2 +- rehlds/engine/pr_cmds.cpp | 7 +- rehlds/engine/sv_log.cpp | 2 +- rehlds/engine/sv_main.cpp | 48 ++-- rehlds/engine/sv_phys.cpp | 2 +- rehlds/engine/sv_upld.cpp | 5 +- rehlds/engine/sv_user.cpp | 20 +- rehlds/engine/sv_user.h | 3 - rehlds/engine/sys_dll.cpp | 2 +- rehlds/engine/sys_dll2.cpp | 4 +- rehlds/engine/sys_dll2.h | 4 +- rehlds/engine/sys_engine.cpp | 2 +- rehlds/engine/sys_engine.h | 2 +- rehlds/engine/tmessage.cpp | 24 +- rehlds/engine/unicode_strtools.cpp | 18 +- rehlds/engine/vid_null.cpp | 2 +- rehlds/filesystem/CMakeLists.txt | 4 + .../FileSystem_Stdio/CMakeLists.txt | 93 ++++++++ .../FileSystem_Stdio/src/BaseFileSystem.cpp | 14 +- .../src/filesystem_helpers.cpp | 2 +- rehlds/hookers/HLTV/Core/DeltaEx.cpp | 14 +- rehlds/public/engine_hlds_api.h | 2 +- rehlds/public/idedicatedexports.h | 2 +- rehlds/public/interface.cpp | 4 +- rehlds/public/rehlds/rehlds_api.h | 4 +- rehlds/public/tier0/characterset.cpp | 2 +- rehlds/public/tier0/dbg.cpp | 4 +- rehlds/public/utlbuffer.cpp | 4 +- rehlds/public/utlrbtree.h | 7 +- rehlds/rehlds/jitasm.h | 2 +- rehlds/rehlds/platform.cpp | 6 +- rehlds/rehlds/rehlds_api_impl.h | 4 +- rehlds/version/appversion.sh | 158 +++++++++++++ 93 files changed, 1863 insertions(+), 842 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 CMakeLists.txt create mode 100644 dep/bzip2/CMakeLists.txt create mode 100644 rehlds/CMakeLists.txt create mode 100644 rehlds/HLTV/CMakeLists.txt create mode 100644 rehlds/HLTV/Console/CMakeLists.txt create mode 100644 rehlds/HLTV/Console/msvc/PreBuild.bat create mode 100644 rehlds/HLTV/Core/CMakeLists.txt create mode 100644 rehlds/HLTV/DemoPlayer/CMakeLists.txt create mode 100644 rehlds/HLTV/Director/CMakeLists.txt create mode 100644 rehlds/HLTV/Proxy/CMakeLists.txt create mode 100644 rehlds/dedicated/CMakeLists.txt create mode 100644 rehlds/filesystem/CMakeLists.txt create mode 100644 rehlds/filesystem/FileSystem_Stdio/CMakeLists.txt create mode 100755 rehlds/version/appversion.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ec82c82 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,183 @@ +name: C/C++ CI + +on: + push: + branches: [master] + pull_request: + types: [opened, reopened, synchronize] + release: + types: [published] + +jobs: + windows: + name: 'Windows' + runs-on: windows-latest + env: + solution: 'msvc/ReHLDS.sln' + buildPlatform: 'Win32' + buildConfiguration: 'Release' + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Nuget + uses: nuget/setup-nuget@v1 + with: + nuget-api-key: ${{ secrets.NuGetAPIKey }} + nuget-version: '5.x' + - run: nuget restore '${{ env.solution }}' + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.0.2 + with: + vs-version: '16.8' + + - name: Build ReHLDS + run: + msbuild ${{ env.solution }} /t:Clean,Build -p:Configuration="${{ env.buildConfiguration }}" /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false + + - name: Move files + run: | + mkdir publish\debug + mkdir publish\bin\win32\valve\dlls + move msvc\${{ env.buildConfiguration }}\hlds.exe publish\bin\win32\hlds.exe + move msvc\${{ env.buildConfiguration }}\hltv.exe publish\bin\win32\hltv.exe + move msvc\${{ env.buildConfiguration }}\swds.dll publish\bin\win32\swds.dll + move msvc\${{ env.buildConfiguration }}\core.dll publish\bin\win32\core.dll + move msvc\${{ env.buildConfiguration }}\proxy.dll publish\bin\win32\proxy.dll + move msvc\${{ env.buildConfiguration }}\demoplayer.dll publish\bin\win32\demoplayer.dll + move msvc\${{ env.buildConfiguration }}\filesystem_stdio.dll publish\bin\win32\filesystem_stdio.dll + move msvc\${{ env.buildConfiguration }}\director.dll publish\bin\win32\valve\dlls\director.dll + move msvc\${{ env.buildConfiguration }}\hlds.pdb publish\debug\hlds.pdb + move msvc\${{ env.buildConfiguration }}\hltv.pdb publish\debug\hltv.pdb + move msvc\${{ env.buildConfiguration }}\swds.pdb publish\debug\swds.pdb + move msvc\${{ env.buildConfiguration }}\core.pdb publish\debug\core.pdb + move msvc\${{ env.buildConfiguration }}\proxy.pdb publish\debug\proxy.pdb + move msvc\${{ env.buildConfiguration }}\demoplayer.pdb publish\debug\demoplayer.pdb + move msvc\${{ env.buildConfiguration }}\filesystem_stdio.pdb publish\debug\filesystem_stdio.pdb + move msvc\${{ env.buildConfiguration }}\director.pdb publish\debug\director.pdb + + - name: Deploy artifacts + uses: actions/upload-artifact@v2 + with: + name: win32 + path: publish/* + + linux: + name: 'Linux' + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Check dependencies + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install -y gcc-multilib g++-multilib + sudo apt-get install -y build-essential + sudo apt-get install -y libc6-dev libc6-dev-i386 + sudo apt-get install -y p7zip-full + + - name: Build + run: | + mkdir build + cd build + cmake ../ + make + + - name: Prepare HLSDK + run: | + mkdir -p publish/hlsdk + rsync -a rehlds/common/ publish/hlsdk/common/ + rsync -a rehlds/dlls/ publish/hlsdk/dlls/ + rsync -a rehlds/pm_shared/ publish/hlsdk/pm_shared/ + rsync -a rehlds/public/ publish/hlsdk/public/ --exclude rehlds/ + rsync -a rehlds/public/rehlds/ publish/hlsdk/engine + + - name: Move files + run: | + mkdir -p publish/bin/linux32/valve/dlls + mv build/rehlds/engine_i486.so publish/bin/linux32/engine_i486.so + mv rehlds/version/appversion.h publish/appversion.h + mv build/rehlds/dedicated/hlds_linux publish/bin/linux32/hlds_linux + mv build/rehlds/HLTV/Console/hltv publish/bin/linux32/hltv + mv build/rehlds/HLTV/Core/core.so publish/bin/linux32/core.so + mv build/rehlds/HLTV/Proxy/proxy.so publish/bin/linux32/proxy.so + mv build/rehlds/HLTV/DemoPlayer/demoplayer.so publish/bin/linux32/demoplayer.so + mv build/rehlds/HLTV/Director/director.so publish/bin/linux32/valve/dlls/director.so + mv build/rehlds/filesystem/FileSystem_Stdio/filesystem_stdio.so publish/bin/linux32/filesystem_stdio.so + + - name: Deploy artifacts + uses: actions/upload-artifact@v2 + id: upload-job + with: + name: linux32 + path: publish/* + + - name: Cleanup temporary artifacts + if: success() && steps.upload-job.outcome == 'success' + run: | + rm -rf hlsdk + rm -f appversion.h + + publish: + needs: [windows, linux] + name: 'Publish' + runs-on: ubuntu-latest + steps: + - name: Deploying linux artifacts + uses: actions/download-artifact@v2 + with: + name: linux32 + + - name: Deploying windows artifacts + uses: actions/download-artifact@v2 + with: + name: win32 + + - name: Reading appversion.h + run: | + if [ -e appversion.h ]; then + APP_VERSION=$(cat appversion.h | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g') + if [ $? -ne 0 ]; then + APP_VERSION="" + else + # Remove quotes + APP_VERSION=$(echo $APP_VERSION | xargs) + echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV + fi + fi + rm -f appversion.h + + - name: Packaging bin/dbg + id: packaging-job + if: | + github.event_name == 'release' && + github.event.action == 'published' && + startsWith(github.ref, 'refs/tags/') + run: | + 7z a -tzip rehlds-bin-${{ env.APP_VERSION }}.zip bin/ hlsdk/ + 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -aoa rehlds-dbg-${{ env.APP_VERSION }}.7z debug/ + + - name: Publish artifacts + uses: softprops/action-gh-release@v1 + id: publish-job + if: | + startsWith(github.ref, 'refs/tags/') && + steps.packaging-job.outcome == 'success' + with: + files: | + *.zip + *.7z + env: + GITHUB_TOKEN: ${{ secrets.API_TOKEN }} + + - name: Cleanup temporary artifacts + if: success() && steps.publish-job.outcome == 'success' + run: | + rm -rf bin debug hlsdk + rm -f *.7z *.zip appversion.h diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2046105 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.1) +project(rehlds CXX) + +if (WIN32) + message(FATAL_ERROR "CMakeLists.txt Windows platform isn't supported yet. Use msvc/ReHLDS.sln instead it!") +endif() + +add_subdirectory(rehlds) +add_subdirectory(rehlds/dedicated) +add_subdirectory(rehlds/filesystem) +add_subdirectory(rehlds/HLTV) diff --git a/README.md b/README.md index 0a1e3d7..b2a1e90 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -# Rehlds [![Build Status](http://teamcity.rehlds.org/app/rest/builds/buildType:(id:Rehlds_Publish)/statusIcon)](http://teamcity.rehlds.org/viewType.html?buildTypeId=Rehlds_Publish&guest=1) [![Download](https://camo.githubusercontent.com/65c70643ec7b40eea50971003624c2fb04d8d375/687474703a2f2f7265686c64732e6f72672f76657273696f6e2f7265686c64732e737667)](http://teamcity.rehlds.org/guestAuth/downloadArtifacts.html?buildTypeId=Rehlds_Publish&buildId=lastSuccessful) ReHLDS - +# ReHLDS [![C/C++ CI](https://github.com/dreamstalker/rehlds/actions/workflows/build.yml/badge.svg)](https://github.com/dreamstalker/rehlds/actions/workflows/build.yml) [![Download](https://camo.githubusercontent.com/7ab483250adb4037b26e9575331218ee51108190d0938b7836d32f1209ccf907/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f647265616d7374616c6b65722f7265686c64732e737667)](https://github.com/dreamstalker/rehlds/releases/latest) [![Downloads](https://camo.githubusercontent.com/d37654956d99bb9fb7a348fdac39b214d6ae14a7cfb9f96bf873c6b46cdf9ef6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f647265616d7374616c6b65722f7265686c64732f746f74616c3f636f6c6f723d696d706f7274616e74)]() [![Percentage of issues still open](http://isitmaintained.com/badge/open/dreamstalker/rehlds.svg)](http://isitmaintained.com/project/dreamstalker/rehlds "Percentage of issues still open") [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ReHLDS Reverse-engineered (and bugfixed) HLDS ## What is this? @@ -7,7 +6,7 @@ ReHLDS is a result of reverse engineering of original HLDS (build 6152/6153) usi Along with reverse engineering, a lot of defects and (potential) bugs were found and fixed -You can try play on one of the servers that using rehlds: http://www.gametracker.com/search/?search_by=server_variable&search_by2=sv_version +You can try play on one of the servers that using rehlds: [Game Tracker](http://www.gametracker.com/search/?search_by=server_variable&search_by2=sv_version) ## Goals of the project