This commit introduces three new GitHub Actions workflow files to automate
the compilation of the Telegram Desktop application on Linux, macOS, and
Windows platforms.
- `.github/workflows/build-linux.yml`: Defines the Linux build process,
leveraging the existing Docker setup for dependency management and compilation.
- `.github/workflows/build-macos.yml`: Defines the macOS build process,
including steps for dependency preparation using `prepare.py`, caching,
and building via CMake.
- `.github/workflows/build-windows.yml`: Defines the Windows build process,
similarly using `prepare.py` for dependencies, caching, and MSVC/CMake
for compilation.
The workflows are designed to compile the application and upload the resulting
binaries as artifacts. They attempt to use existing build scripts and tools
from the repository where possible. Adjustments have been made based on analysis
of scripts like `prepare.py` and `qt_version.py` to correctly set environment
variables (e.g., QT versions).
A potential issue not fully resolvable without live testing is the dependency
on a `DesktopPrivate` repository, which is checked in some build scripts.
If this is essential for basic compilation, the workflows might require further
adjustments or access to this private repository.
The error occurred when adding a new fields, for example showForwards, to the AyuGramSettings class. The NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT macro was used for serialization, which works correctly only when the number of parameters is up to 64. After extending the structure, the macro failed to expand and the compiler started generating messages about undefined identifiers like NLOHMANN_JSON_TO.
The fix was to replace the problematic macro with manual implementation of to_json and from_json functions. For each field, it is now explicitly specified how to serialize and deserialize it, which eliminates the limitation on the number of arguments. Additionally, auxiliary macros NLOHMANN_JSON_TO, NLOHMANN_JSON_FROM and NLOHMANN_JSON_FROM_WITH_DEFAULT have been declared in case they are absent in the header file used.
More info: https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/#notes