diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a259608..2d73d17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,47 +4,59 @@ name: Build on: push: - branches: [gh-actions] - pull_request: - branches: [gh-actions] + branches: dev jobs: - windows_build: - name: Windows build - runs-on: windows-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" - steps: - - name: Checkout repo - uses: actions/checkout@v2 + windows_build: + name: Windows build + runs-on: windows-latest + if: "!contains(github.event.head_commit.message, '[skip ci]')" + steps: + - name: Checkout repo + uses: actions/checkout@v2 - - name: Cache vcpkg - uses: actions/cache@v1 - with: - path: vcpkg - key: ${{ runner.os }}-vcpkg-${{ hashFiles('build.windows') }} - - - name: vcpkg - run: | - if(!(Test-Path .\vcpkg)) - { - git clone https://github.com/microsoft/vcpkg.git - cd vcpkg - .\bootstrap-vcpkg.bat - .\vcpkg.exe integrate install - .\vcpkg.exe install '@${{ github.workspace }}/build.windows' - } + - name: Cache vcpkg + uses: actions/cache@v1 + with: + path: vcpkg + key: ${{ runner.os }}-vcpkg-${{ hashFiles('build.windows') }} + + - name: vcpkg + run: | + if(!(Test-Path .\vcpkg)) + { + git clone https://github.com/microsoft/vcpkg.git + cd vcpkg + .\bootstrap-vcpkg.bat + .\vcpkg.exe integrate install + .\vcpkg.exe install '@${{ github.workspace }}/build.windows' + } - - name: cmake - run: cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 16 2019" -A x64 . + - name: cmake + run: cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 16 2019" -A x64 . - - name: Setup MSBuild.exe - uses: microsoft/Setup-MSBuild@v1.0.2 + - name: Setup MSBuild.exe + uses: microsoft/Setup-MSBuild@v1.0.2 - - name: MSBuild - run: msbuild brokenithm-kb.sln -p:Configuration=Release /m /verbosity:minimal + - name: MSBuild + run: msbuild brokenithm-kb.sln -p:Configuration=Release /m /verbosity:minimal - - name: Upload artifact - uses: actions/upload-artifact@master - with: - name: Game - path: bin + - name: Upload artifact + uses: actions/upload-artifact@master + with: + name: brokenithm-kb + path: bin + + - name: Zip release + if: startsWith(github.ref, 'refs/tags/v') + uses: montudor/action-zip@v1 + with: + args: zip -qq -r brokenithm-kb.zip zip + + - name: Create release + if: startsWith(github.ref, 'refs/tags/v') + uses: marvinpinto/action-automatic-releases@v1.1.2 + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + draft: true + files: brokenithm-kb.zip diff --git a/.gitignore b/.gitignore index 8c674e3..660008c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .vs/ build/ -res/chart/* -!res/chart/.gitkeep dist/ +src/src/version.rc diff --git a/CMakeLists.txt b/CMakeLists.txt index 209628e..886bdb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,8 @@ cmake_minimum_required(VERSION 3.15) -set(CMAKE_SYSTEM_VERSION "10.0.18362") -# set(CMAKE_SYSTEM_VERSION "10.0.19041") +set(CMAKE_SYSTEM_VERSION "10.0.19041") -project(brokenithm-kb VERSION 0.2.0) +project(brokenithm-kb VERSION 0.1.1) message("Using kit " "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 57d7eba..d704c0f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,12 @@ add_subdirectory(Vendor) set(SRCROOT ${CMAKE_CURRENT_SOURCE_DIR}/src/) +# Inject version number +configure_file( + ${SRCROOT}/version.rc.in + ${SRCROOT}/version.rc + @ONLY) + file(GLOB SRC "${SRCROOT}/*.cpp" "${SRCROOT}/*.hpp" "${SRCROOT}/*.rc") source_group("Sources" FILES ${SRC}) @@ -17,5 +23,5 @@ target_link_libraries(brokenithm-kb PRIVATE uws optparse spdlog) add_custom_command( TARGET brokenithm-kb POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/res/ $/res/ - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/scripts/ $/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/static/ $/ ) diff --git a/src/src/application.rc b/src/src/icon.rc similarity index 100% rename from src/src/application.rc rename to src/src/icon.rc diff --git a/src/src/main.cpp b/src/src/main.cpp index dc6cd01..ac10b7c 100644 --- a/src/src/main.cpp +++ b/src/src/main.cpp @@ -5,6 +5,8 @@ #include "KeyboardSimulator.hpp" #include "Utils.hpp" +#include "version.rc" + std::string banner = R"( _ _ _ _ _ _ _ | |__ _ __ ___ | | _____ _ __ (_) |_| |__ _ __ ___ | | _| |__ @@ -12,8 +14,7 @@ std::string banner = R"( | |_) | | | (_) | < __/ | | | | |_| | | | | | | | |_____| <| |_) | |_.__/|_| \___/|_|\_\___|_| |_|_|\__|_| |_|_| |_| |_| |_|\_\_.__/ ======================================================================= -Brokenithm controller for keyboard output, by github/@4yn -)"; +Brokenithm controller for keyboard output, by @4yn, v)" VERSION_STRING; std::string epilog = R"( Open the URL displayed on a touch-enabled device (big iPads recommended) @@ -24,13 +25,13 @@ correct firewall access is granted. Built for use with simulators like Seaurchin and SUSPlayer. Keyboard output follows the Yuancon specification. -Find more options with: ./brokenithm-kb.exe -h -)"; +Read more at https://github.com/4yn/brokenithm-kb)"; int main(int argc, char **argv) { optparse::OptionParser parser = optparse::OptionParser() .description(banner.substr(1)) + .version(VERSION_STRING) .epilog(epilog.substr(1)); parser.add_option("-p", "--port").dest("port").type("int").set_default(1116).help("Port to listen on (1-65535)"); diff --git a/src/src/version.rc.in b/src/src/version.rc.in new file mode 100644 index 0000000..ee6fe74 --- /dev/null +++ b/src/src/version.rc.in @@ -0,0 +1 @@ +#define VERSION_STRING "@PROJECT_VERSION@" diff --git a/static/README.txt b/static/README.txt new file mode 100644 index 0000000..65c72be --- /dev/null +++ b/static/README.txt @@ -0,0 +1,26 @@ + _ _ _ _ _ _ _ +| |__ _ __ ___ | | _____ _ __ (_) |_| |__ _ __ ___ | | _| |__ +| '_ \| '__/ _ \| |/ / _ \ '_ \| | __| '_ \| '_ ` _ \ _____| |/ / '_ \ +| |_) | | | (_) | < __/ | | | | |_| | | | | | | | |_____| <| |_) | +|_.__/|_| \___/|_|\_\___|_| |_|_|\__|_| |_|_| |_| |_| |_|\_\_.__/ +======================================================================= +Brokenithm controller for keyboard output, by @4yn + +Open the URL displayed on a touch-enabled device (big iPads recommended) +connected to the same wifi access point as your windows machine. +Running a hotspot from your windows machine also works. Make sure +correct firewall access is granted. + +Built for use with simulators like Seaurchin and SUSPlayer. +Keyboard output follows the Yuancon specification. + +Read more at https://github.com/4yn/brokenithm-kb + +CHANGELOG +========= + +v0.1.1 +- Removed openssl/zlib bloat + +v0.1 +- Initial release diff --git a/scripts/run.bat b/static/run.bat similarity index 100% rename from scripts/run.bat rename to static/run.bat