Skip to content

Commit

Permalink
Rework CI and build process. Update sample code.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneko committed Nov 17, 2023
1 parent de8e82a commit 5027fcf
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 24 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,29 @@ jobs:
with:
version: ${{ matrix.ci_emsdk_version }}

- uses: actions/checkout@v2
- name: Checkout Sample Project
uses: actions/checkout@v2
with:
path: ${{ env.ci_source_dir }}
fetch-depth: 1
submodules: true

- name: Checkout the Framework
uses: actions/checkout@v2
with:
repository: rbfx/rbfx
path: ${{ env.ci_source_dir }}/../rbfx
fetch-depth: 1
submodules: true

- name: Download native SDK
uses: robinraju/[email protected]
with:
repository: rbfx/rbfx
tag: latest
fileName: rebelfork-bin-Linux-clang-rel-dll-x64-latest.zip
extract: true

- name: Setup cmake
uses: jwlawson/[email protected]
with:
Expand All @@ -74,10 +91,10 @@ jobs:
run: ${{ env.ci_build_script }} prepare

- name: Publish
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'rbfx/sample-project' }}
if: ${{ github.ref == 'refs/heads/test' && github.repository == 'rbfx/sample-project' }}
uses: KikimoraGames/[email protected]
with:
butlerAPIKey: ${{ secrets.BUTLER_API_KEY }}
butlerApiKey: ${{ secrets.BUTLER_API_KEY }}
gameData: ${{ github.workspace }}/cmake-build/bin/project
itchUsername: eugeneko
itchGameId: sample-project
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion 3rdParty/rbfx
Submodule rbfx deleted from 3460bb
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ set (URHO3D_EDITOR OFF CACHE BOOL "")
set (URHO3D_PLUGIN_LIST ${CMAKE_PROJECT_NAME} CACHE BOOL "")

# Include common build scripts.
include (${CMAKE_SOURCE_DIR}/3rdParty/rbfx/CMake/Modules/UrhoCommon.cmake)
include (${CMAKE_SOURCE_DIR}/../rbfx/CMake/Modules/UrhoCommon.cmake)

# Include the Framework.
add_subdirectory (${CMAKE_SOURCE_DIR}/3rdParty/rbfx)
# Include the Framework to build.
add_subdirectory (../rbfx ${CMAKE_BINARY_DIR}/3rdParty/rbfx)

# Add project source files.
add_subdirectory (${CMAKE_SOURCE_DIR}/Source)
Expand All @@ -49,8 +49,8 @@ add_subdirectory (${CMAKE_SOURCE_DIR}/Launcher)

# Add custom player and editor with injected plugins.
if (NOT ANDROID)
add_subdirectory (${CMAKE_SOURCE_DIR}/3rdParty/rbfx/Source/Player)
add_subdirectory (${CMAKE_SOURCE_DIR}/3rdParty/rbfx/Source/Editor)
add_subdirectory (${rbfx_SOURCE_DIR}/Source/Player ${CMAKE_BINARY_DIR}/3rdParty/rbfx/Source/Player)
add_subdirectory (${rbfx_SOURCE_DIR}/Source/Editor ${CMAKE_BINARY_DIR}/3rdParty/rbfx/Source/Editor)
endif()

# Package resources from Project directory.
Expand All @@ -70,5 +70,5 @@ if (WEB)
INSTALL_TO "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)
web_link_resources(Player Resources.js)
target_link_libraries(Player PRIVATE "--shell-file ${CMAKE_SOURCE_DIR}/3rdParty/rbfx/bin/shell.html")
target_link_libraries(Player PRIVATE "--shell-file ${rbfx_SOURCE_DIR}/bin/shell.html")
endif ()
4 changes: 2 additions & 2 deletions Launcher/Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ void Launcher::Start()
auto* cache = GetSubsystem<ResourceCache>();
auto* ui = GetSubsystem<RmlUI>();
ea::vector<ea::string> fonts;
cache->Scan(fonts, "Fonts/", "*.ttf", SCAN_FILES, true);
cache->Scan(fonts, "Fonts/", "*.otf", SCAN_FILES, true);
cache->Scan(fonts, "Fonts/", "*.ttf", SCAN_FILES);
cache->Scan(fonts, "Fonts/", "*.otf", SCAN_FILES);
for (const ea::string& font : fonts)
ui->LoadFont(Format("Fonts/{}", font));
#endif
Expand Down
2 changes: 1 addition & 1 deletion Script/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function action-generate() {
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DEMSCRIPTEN_ROOT_PATH=$EMSDK/upstream/emscripten/ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$ci_sdk_dir \
-DURHO3D_SDK=$ci_sdk_dir \
-DCI_WEB_BUILD=ON \
-DBUILD_SHARED_LIBS=OFF \
-DURHO3D_PROFILING=OFF \
Expand Down
17 changes: 10 additions & 7 deletions Source/MenuGameScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@ void MainMenuWindow::SetGame(SampleGameScreen* game)
DirtyAllVariables();
}

void MainMenuWindow::OnDataModelInitialized(Rml::DataModelConstructor& constructor)
void MainMenuWindow::OnDataModelInitialized()
{
constructor.RegisterArray<StringVector>();
Rml::DataModelConstructor* constructor = GetDataModelConstructor();
URHO3D_ASSERT(constructor);

constructor.Bind("is_game_played", &isGamePlayed_);
constructor->RegisterArray<StringVector>();

constructor.BindEventCallback("on_continue", WrapCallback(&MainMenuWindow::OnContinue));
constructor.BindEventCallback("on_new_game", WrapCallback(&MainMenuWindow::OnNewGame));
constructor.BindEventCallback("on_settings", WrapCallback(&MainMenuWindow::OnSettings));
constructor.BindEventCallback("on_exit", WrapCallback(&MainMenuWindow::OnExit));
constructor->Bind("is_game_played", &isGamePlayed_);

constructor->BindEventCallback("on_continue", WrapCallback(&MainMenuWindow::OnContinue));
constructor->BindEventCallback("on_new_game", WrapCallback(&MainMenuWindow::OnNewGame));
constructor->BindEventCallback("on_settings", WrapCallback(&MainMenuWindow::OnSettings));
constructor->BindEventCallback("on_exit", WrapCallback(&MainMenuWindow::OnExit));
}

MenuGameScreen* MainMenuWindow::GetApplicationState() const
Expand Down
2 changes: 1 addition & 1 deletion Source/MenuGameScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MainMenuWindow : public RmlUIComponent
/// Implement RmlUIComponent
/// @{
void Update(float timeStep) override;
void OnDataModelInitialized(Rml::DataModelConstructor& constructor) override;
void OnDataModelInitialized() override;
/// @}

void OnNewGame();
Expand Down

0 comments on commit 5027fcf

Please sign in to comment.