From afeb29f81b907dfad05e28579ab9d29247865b10 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 9 Oct 2022 13:06:03 +0200 Subject: [PATCH] Log the module version on each application start --- .github/workflows/ci.yml | 7 +++++++ .github/workflows/pr.yml | 7 +++++++ src/main.cpp | 4 ++++ src/version.h | 2 ++ 4 files changed, 20 insertions(+) create mode 100644 src/version.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14b2964..fb5e48f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v2 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + cat < ./src/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 224e419..891751d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,6 +26,13 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v2 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}") + cat < ./src/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/src/main.cpp b/src/main.cpp index 6eff875..7eb00a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include "globals.h" #include "utils/StringTools.h" #include "utils/logger.h" +#include "version.h" #include #include #include @@ -15,6 +16,8 @@ #include #include +#define VERSION "v0.2.1" + WUMS_MODULE_EXPORT_NAME("homebrew_rpx_loader"); WUMS_USE_WUT_DEVOPTAB(); @@ -78,6 +81,7 @@ WUMS_APPLICATION_STARTS() { if (upid != 2 && upid != 15) { return; } + OSReport("Running RPXLoadingModule " VERSION VERSION_EXTRA "\n"); initLogging(); if (gReplacementInfo.rpxReplacementInfo.willRPXBeReplaced) { gReplacementInfo.rpxReplacementInfo.willRPXBeReplaced = false; diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..66a2c7e --- /dev/null +++ b/src/version.h @@ -0,0 +1,2 @@ +#pragma once +#define VERSION_EXTRA "" \ No newline at end of file