Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7f77c7e
chore: don't commit SSL serts or IDE folders
XenoSnowFox Aug 19, 2026
bed1084
feat: generate a version.hpp file
XenoSnowFox Aug 19, 2026
e5d4bf4
refactor: rename APP_VERSION to be BUILD_VERSION
XenoSnowFox Aug 19, 2026
615b979
ci: add a github workflow to tag releases and increment the version n…
XenoSnowFox Aug 19, 2026
dba8252
ci: update the release workflow to use vcpkg for dependency management
XenoSnowFox Aug 19, 2026
77dcecf
ci: remove unused dependencies
XenoSnowFox Aug 19, 2026
391c3c6
Merge branch 'main' into ci/build-versioning
XenoSnowFox Aug 19, 2026
63d7d7a
ci: add build pin for vcpkg
XenoSnowFox Aug 19, 2026
67e9d73
Merge branch 'main' of https://github.com/xtrpg/xtrpg-cpp-server into…
XenoSnowFox Aug 19, 2026
6e71efd
Merge branch 'main' into ci/build-versioning
XenoSnowFox Aug 19, 2026
4630b18
ci: config vcpkg to download outside the git repository directory
XenoSnowFox Aug 19, 2026
de22a8f
Merge branch 'main' of https://github.com/xtrpg/xtrpg-cpp-server into…
XenoSnowFox Aug 19, 2026
2b5a058
Update release.yml
XenoSnowFox Aug 19, 2026
65b39fd
ci: add workflow to test that a PR builds and compiles
XenoSnowFox Aug 19, 2026
34267e9
fix: rename step
XenoSnowFox Aug 19, 2026
37a66b0
fix: permissions
XenoSnowFox Aug 19, 2026
361350a
Update build.yml
XenoSnowFox Aug 19, 2026
8744763
fix: checkout vcpkg by thier tag
XenoSnowFox Aug 19, 2026
f7d8775
ci: move away from lukka/run-vcpkg
XenoSnowFox Aug 19, 2026
57491bc
fix: vcpkg repo path
XenoSnowFox Aug 19, 2026
d3a7678
fix: path to vcpkg cmake file
XenoSnowFox Aug 19, 2026
ccb55fc
ci: remove unused dependecy
XenoSnowFox Aug 19, 2026
1d9a767
Update CMakeLists.txt
XenoSnowFox Aug 19, 2026
1a3fcdc
Update CMakeLists.txt
XenoSnowFox Aug 19, 2026
f750cf2
Update CMakeLists.txt
XenoSnowFox Aug 19, 2026
5a942ef
Update CMakeLists.txt
XenoSnowFox Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Automated Release Build

on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
# push:
# branches:
# - main

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Fetch the official vcpkg repo directly
- name: Checkout vcpkg
uses: actions/checkout@v4
with:
repository: "Microsoft/vcpkg"
path: "vcpkg"

- name: Bootstrap vcpkg
run: |
./vcpkg/bootstrap-vcpkg.sh
shell: bash

# Set up GitHub Actions Cache for vcpkg binary caching
- name: Setup vcpkg Cache
uses: actions/cache@v4
with:
path: |
~/.cache/vcpkg
~/.vcpkg
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-

# Configure CMake passing the vcpkg toolchain file
- name: Configure CMake with New Version
run: |
cmake -B build -S . \
-DCMAKE_TOOLCHAIN_FILE="./vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_BUILD_TYPE=Release

# Build the C++ Binary
- name: Build C++ Binary
run: cmake --build build --config Release
33 changes: 22 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,29 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0


- name: Configure Git Safe Directory
run: git config --global --add safe.directory '*'

# Set up vcpkg executable and binary cache
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
# Fetch the official vcpkg repo directly
- name: Checkout vcpkg
uses: actions/checkout@v4
with:
repository: "Microsoft/vcpkg"
path: "vcpkg"

- name: Bootstrap vcpkg
run: |
./vcpkg/bootstrap-vcpkg.sh
shell: bash

# Set up GitHub Actions Cache for vcpkg binary caching
- name: Setup vcpkg Cache
uses: actions/cache@v4
with:
# Uses the vcpkg.json in the repository root
vcpkgDirectory: '${{ github.workspace }}/../vcpkg'
vcpkgJsonGlob: 'vcpkg.json'
path: |
~/.cache/vcpkg
~/.vcpkg
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-

# Automatically calculate the next version string based on commits
- name: Calculate Next Version
Expand All @@ -43,7 +54,7 @@ jobs:
- name: Configure CMake with New Version
run: |
cmake -B build -S . \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE="./vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DBUILD_VERSION="${{ steps.semver.outputs.version }}" \
-DCMAKE_BUILD_TYPE=Release

Expand Down
65 changes: 29 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find Packages - vcpkg provides standard CMake target configs
find_package(asio CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(pugixml CONFIG REQUIRED)
find_package(threads REQUIRED)

# Append cmake directory to module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
Expand All @@ -41,46 +39,41 @@ set(USER_MODULES_DIR "" CACHE PATH "Directory containing custom XMPP user module
find_package(UserModules QUIET)

# Modular Build Options
option(ENABLE_STORAGE_MEMORY "Include in-memory storage backend" ON)
option(ENABLE_STORAGE_SQLITE "Include SQLite storage backend" OFF)
option(ENABLE_STORAGE_POSTGRES "Include PostgreSQL storage backend" OFF)
# option(ENABLE_STORAGE_MEMORY "Include in-memory storage backend" ON)
# option(ENABLE_STORAGE_SQLITE "Include SQLite storage backend" OFF)
# option(ENABLE_STORAGE_POSTGRES "Include PostgreSQL storage backend" OFF)

# Core Server Target
add_library(xtrpg_core STATIC
src/core/C2SServer.cpp
src/core/S2SServer.cpp
src/core/ModuleRegistry.cpp
)
target_include_directories(xtrpg_core PUBLIC include)
# add_library(xtrpg_core STATIC
# )
# target_include_directories(xtrpg_core PUBLIC include)

# Link imported targets across platforms
target_link_libraries(xtrpg_core PUBLIC
asio::asio
OpenSSL::SSL
OpenSSL::Crypto
pugixml::pugixml
Threads::Threads
)
# target_link_libraries(xtrpg_core PUBLIC
# asio::asio
# OpenSSL::SSL
# OpenSSL::Crypto
# )

# Platform-specific OS network primitives for raw sockets
if(WIN32)
target_link_libraries(xtrpg_core PUBLIC ws2_32 wsock32 crypt32)
elseif(UNIX AND NOT APPLE)
target_link_libraries(xtrpg_core PUBLIC pthread dl)
endif()
# if(WIN32)
# target_link_libraries(xtrpg_core PUBLIC ws2_32 wsock32 crypt32)
# elseif(UNIX AND NOT APPLE)
# target_link_libraries(xtrpg_core PUBLIC pthread dl)
# endif()

# Conditional Storage Compilation
if(ENABLE_STORAGE_SQLITE)
find_package(SQLite3 REQUIRED)
target_sources(xtrpg_core PRIVATE src/storage/SQLiteBackend.cpp)
target_compile_definitions(xtrpg_core PUBLIC HAS_STORAGE_SQLITE)
target_link_libraries(xtrpg_core PRIVATE SQLite::SQLite3)
endif()

if(ENABLE_STORAGE_MEMORY)
target_sources(xtrpg_core PRIVATE src/storage/MemoryBackend.cpp)
target_compile_definitions(xtrpg_core PUBLIC HAS_STORAGE_MEMORY)
endif()
# if(ENABLE_STORAGE_SQLITE)
# find_package(SQLite3 REQUIRED)
# target_sources(xtrpg_core PRIVATE src/storage/SQLiteBackend.cpp)
# target_compile_definitions(xtrpg_core PUBLIC HAS_STORAGE_SQLITE)
# target_link_libraries(xtrpg_core PRIVATE SQLite::SQLite3)
# endif()

# if(ENABLE_STORAGE_MEMORY)
# target_sources(xtrpg_core PRIVATE src/storage/MemoryBackend.cpp)
# target_compile_definitions(xtrpg_core PUBLIC HAS_STORAGE_MEMORY)
# endif()

# Include discovered modules into the build
if(UserModules_FOUND)
Expand All @@ -96,10 +89,10 @@ endif()

# Executable Target
add_executable(xtrpg_cpp_server apps/main.cpp)
target_link_libraries(xtrpg_cpp_server PRIVATE xtrpg_core)
# target_link_libraries(xtrpg_cpp_server PRIVATE xtrpg_core)
target_include_directories(xtrpg_cpp_server PRIVATE ${CMAKE_BINARY_DIR}/generated)

# If modules produce targets registered via xmpp_register_user_module
if(USER_MODULE_TARGETS)
target_link_libraries(xmpp_server PRIVATE ${USER_MODULE_TARGETS})
target_link_libraries(xtrpg_cpp_server PRIVATE ${USER_MODULE_TARGETS})
endif()
1 change: 0 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "xtrpg-cpp-server",
"version-string": "0.1.0",
"builtin-baseline": "501db0f171095204123565f4262ae7d17482ea05",
"dependencies": [
"asio",
"openssl"
Expand Down
Loading