Skip to content

Commit

Permalink
Merge pull request #33 from MasterLaplace/30-feature-version-bumper-a…
Browse files Browse the repository at this point in the history
…nd-release

30 feature version bumper and release
  • Loading branch information
MasterLaplace authored Nov 7, 2024
2 parents 0415a41 + 715e4cc commit aa2701f
Show file tree
Hide file tree
Showing 38 changed files with 819 additions and 287 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/commit_norm_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
verify-commit-name:
Expand All @@ -19,14 +16,15 @@ jobs:
- name: Commit Norm Checker
run: |
commit_msg=$(git log --format=%B -n 1 ${{ github.sha }})
keyword_regex="^([a-z]+\([0-9A-Za-z_.-]+\)|^[a-z]+): "
keyword_regex="^([a-z]+\([0-9A-Za-z_.-]+\)|^[a-z]+): [0-9a-z_.-]+"
if [[ ! $commit_msg =~ $keyword_regex ]]; then
if [[ $commit_msg =~ ^Merge\ .* ]]; then
echo "Skipping merge commit"
else
echo $commit_msg
echo "Commit message does not match expected format. Please use the following format: \"keyword(scope): comment\""
echo "Commit message does not match Angular convention."
exit 1
fi
fi
shell: bash
3 changes: 0 additions & 3 deletions .github/workflows/cpp_norm_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
build:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/create_minor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Bump Minor Version and Create Release

on:
milestone:
types: closed

permissions:
contents: write

jobs:
create_minor_release:
name: Bump version and create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Run Version Bump Script
run: |
python3 Scripts/increment_version.py minor
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}

- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Push changes
run: |
git add .
git commit -m "chore: bump the Flakkari minor version" || true
git push || true
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: minor

- name: Create a GitHub release
uses: ncipollo/[email protected]
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Flakkari ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: false
prerelease: false
generateReleaseNotes: true
60 changes: 60 additions & 0 deletions .github/workflows/create_patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Bump Patch Version

on:
pull_request:
types: [closed]
branches:
- master
- main

permissions:
contents: write

jobs:
create_patch_release:
name: Bump version and create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Run Version Bump Script
run: |
python3 Scripts/increment_version.py patch
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}

- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Push changes
run: |
git add .
git commit -m "chore: bump the Flakkari patch version" || true
git push || true
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch

- name: Create a GitHub release
uses: ncipollo/[email protected]
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Flakkari ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: false
prerelease: false
generateReleaseNotes: true
24 changes: 0 additions & 24 deletions .github/workflows/create_release.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ _deps
*.exe
*.out
*.app
flakkari
r-type_server

docs/Flakkari/
Expand Down
33 changes: 19 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Flakkari/CMakeLists.txt
cmake_minimum_required(VERSION 3.22.0)
cmake_minimum_required(VERSION 3.2...3.22)

project(R-Type_Server)
project(Flakkari-Server VERSION 0.2.0 LANGUAGES CXX)

# Add all your source and headers files:
set(SOURCES
Flakkari/core.cpp

Flakkari/Logger/Logger.cpp

Flakkari/Network/Network.cpp
Flakkari/Network/Address.cpp
Flakkari/Network/Buffer.cpp
Flakkari/Network/Socket.cpp
Expand All @@ -33,6 +34,7 @@ set(SOURCES
set(HEADERS
Flakkari/Logger/Logger.hpp

Flakkari/Network/Network.hpp
Flakkari/Network/Packed.hpp
Flakkari/Network/Address.hpp
Flakkari/Network/Buffer.hpp
Expand Down Expand Up @@ -75,6 +77,7 @@ set(HEADER_LIB_LOGGER
)

set(HEADER_LIB_NETWORK
Flakkari/Network/Network.hpp
Flakkari/Network/Packed.hpp
Flakkari/Network/Address.hpp
Flakkari/Network/Buffer.hpp
Expand Down Expand Up @@ -108,32 +111,34 @@ FetchContent_MakeAvailable(nlohmann_json)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(FLAKKARI_GAME_DIR ${CMAKE_SOURCE_DIR}/Games)
message(STATUS "FLAKKARI_GAME_DIR: ${FLAKKARI_GAME_DIR}")

# Compiler Standards:
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Compiler Warnings:
if(MSVC)
if (MSVC)
add_compile_options(/W4)
elseif(WIN32)
elseif (WIN32)
add_compile_options(-Wall -Wextra)
else()
add_compile_options(-Wall -Wextra)
endif()

# Create the executable
add_executable(r-type_server ${SOURCES} ${HEADERS})
add_executable(flakkari ${SOURCES} ${HEADERS})

# Include Directories:
target_include_directories(r-type_server PRIVATE ${CMAKE_SOURCE_DIR}/Flakkari)
target_include_directories(flakkari PRIVATE ${CMAKE_SOURCE_DIR}/Flakkari)

# Link Libraries:
target_link_libraries(r-type_server PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(flakkari PRIVATE nlohmann_json::nlohmann_json)

# Documentation: sudo apt-get install graphviz
find_package(Doxygen)
if(DOXYGEN_FOUND)
if (DOXYGEN_FOUND)
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Doxyfile.cfg
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
Expand All @@ -150,14 +155,14 @@ set(PROJECT_VERSION_PATCH 0)
configure_file(${CMAKE_SOURCE_DIR}/Flakkari/config.h.in ${CMAKE_BINARY_DIR}/config.h)

# Install Targets:
install(TARGETS r-type_server DESTINATION bin)
install(TARGETS flakkari DESTINATION bin)
install(FILES ${CMAKE_BINARY_DIR}/config.h DESTINATION include/Flakkari)
install(FILES ${HEADER_LIB_LOGGER} DESTINATION include/Flakkari/Logger)
install(FILES ${HEADER_LIB_NETWORK} DESTINATION include/Flakkari/Network)
install(FILES ${HEADER_LIB_PROTOCOL} DESTINATION include/Flakkari/Protocol)

# Packaging:
set(CPACK_PACKAGE_NAME "r-type_server")
set(CPACK_PACKAGE_NAME "flakkari")
set(CPACK_PACKAGE_VENDOR "R-Type")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "R-Type Server")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
Expand All @@ -181,14 +186,14 @@ set(SOURCES_LIB_NETWORK
Flakkari/Network/Socket.cpp
Flakkari/Network/IOMultiplexer.cpp
)
add_library(r-type_server_network SHARED ${SOURCES_LIB_NETWORK} ${HEADER_LIB_NETWORK} ${HEADER_LIB_LOGGER})
add_library(flakkari_network SHARED ${SOURCES_LIB_NETWORK} ${HEADER_LIB_NETWORK} ${HEADER_LIB_LOGGER})

# Include Directories:
target_include_directories(r-type_server_network PRIVATE ${CMAKE_SOURCE_DIR}/Flakkari)
target_include_directories(flakkari_network PRIVATE ${CMAKE_SOURCE_DIR}/Flakkari)

# Link Libraries:
target_link_libraries(r-type_server_network PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(flakkari_network PRIVATE nlohmann_json::nlohmann_json)

# Install dynamic library:
install(TARGETS r-type_server_network DESTINATION lib)
install(TARGETS flakkari_network DESTINATION lib)
install(FILES ${HEADER_LIB_NETWORK} DESTINATION include/Flakkari/Network)
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ See the [Table of Contents](#table-of-contents) for different ways to help and d

Here, you can provide a brief overview of what the Flakkari project is about and why contributions are important.

v0.2.0 of the project is currently under development. You can find the latest release [here](https://github.com/MasterLaplace/Flakkari/releases/latest/) and the changelog [here](CHANGELOG.md).
Flakkari is a Epitech/Laval Student project. It is a simple game server written in C++. The project is designed to be a lightweight and easy-to-use server that can be used for various purposes. The server is also part of the Laplace-Project, a collection of libraries that provide a set of tools for developing games, os, applications, and more.
The project is open-source and welcomes contributions from the community. If you're interested in helping out, you can find more information on how to contribute below.
Flakkari is currently under development. You can find the latest release [here](https://github.com/MasterLaplace/Flakkari/releases/latest/) and the changelog [here](CHANGELOG.md).

----

Expand Down
2 changes: 1 addition & 1 deletion Doxyfile.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "Flakkari"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER =
PROJECT_NUMBER = 0.2.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ struct Spawned {
PACKED_END
} // namespace Flakkari::Engine::ECS::Components::Common

#endif /* !SPAWNED_HPP_ */
#endif /* !SPAWNED_HPP_ */
18 changes: 9 additions & 9 deletions Flakkari/Engine/EntityComponentSystem/Systems/Systems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ void position(Registry &r, float deltaTime)
auto& vel = velocities[i];

if (pos.has_value() && vel.has_value()) {
float magnitude = std::sqrt(vel->velocity.dx * vel->velocity.dx + vel->velocity.dy * vel->velocity.dy);
float magnitude = std::sqrt(vel->velocity.vec.x * vel->velocity.vec.x + vel->velocity.vec.y * vel->velocity.vec.y);
if (magnitude > 0.0f) {
vel->velocity.dx /= magnitude;
vel->velocity.dy /= magnitude;
vel->velocity.vec.x /= magnitude;
vel->velocity.vec.y /= magnitude;
}
pos->position.x += vel->velocity.dx * vel->acceleration.x * deltaTime;
pos->position.y += vel->velocity.dy * vel->acceleration.y * deltaTime;
pos->position.vec.x += vel->velocity.vec.x * vel->acceleration.vec.x * deltaTime;
pos->position.vec.y += vel->velocity.vec.y * vel->acceleration.vec.y * deltaTime;
}
}
}
Expand All @@ -51,22 +51,22 @@ void update_control(Registry &r)
if (net->events.size() < int(Protocol::EventId::MOVE_UP))
continue;
if (net->events[int(Protocol::EventId::MOVE_UP)] == int(Protocol::EventState::PRESSED))
vel->velocity.dy = -1;
vel->velocity.vec.y = -1;

if (net->events.size() < int(Protocol::EventId::MOVE_DOWN))
continue;
if (net->events[int(Protocol::EventId::MOVE_DOWN)] == int(Protocol::EventState::PRESSED))
vel->velocity.dy = 1;
vel->velocity.vec.y = 1;

if (net->events.size() < int(Protocol::EventId::MOVE_LEFT))
continue;
if (net->events[int(Protocol::EventId::MOVE_LEFT)] == int(Protocol::EventState::PRESSED))
vel->velocity.dx = -1;
vel->velocity.vec.x = -1;

if (net->events.size() < int(Protocol::EventId::MOVE_RIGHT))
continue;
if (net->events[int(Protocol::EventId::MOVE_RIGHT)] == int(Protocol::EventState::PRESSED))
vel->velocity.dx = 1;
vel->velocity.vec.x = 1;
}
}

Expand Down
Loading

0 comments on commit aa2701f

Please sign in to comment.