From d6e6b9165d5d933203fa1d6effd2e0d9ce03540f Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 28 Jul 2022 14:33:27 +0200 Subject: [PATCH] Display the version in the menu --- .github/workflows/ci.yml | 9 ++++++++- .github/workflows/pr.yml | 9 ++++++++- source/ApplicationState.h | 3 ++- source/version.h | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 source/version.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b147dd..2656a65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,16 @@ jobs: needs: clang-format steps: - uses: actions/checkout@v2 + - name: create version.h + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + cat < ./source/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | - docker build . -t builder + docker build . -t builder docker run --rm -v ${PWD}:/project builder make - uses: actions/upload-artifact@master with: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 171b7bf..00afb57 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,9 +26,16 @@ 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 < ./source/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | - docker build . -t builder + docker build . -t builder docker run --rm -v ${PWD}:/project builder make - uses: actions/upload-artifact@master with: diff --git a/source/ApplicationState.h b/source/ApplicationState.h index 73c9619..17a6f04 100644 --- a/source/ApplicationState.h +++ b/source/ApplicationState.h @@ -4,6 +4,7 @@ #include "input/Input.h" #include "utils/ScreenUtils.h" #include "utils/WiiUScreen.h" +#include "version.h" #include class ApplicationState { @@ -55,7 +56,7 @@ public: } virtual void printHeader() { - WiiUScreen::drawLine("WUDD - Wii U Disc Dumper"); + WiiUScreen::drawLine("WUDD - Wii U Disc Dumper v1.1.0" VERSION_EXTRA); WiiUScreen::drawLine("=================="); WiiUScreen::drawLine(""); } diff --git a/source/version.h b/source/version.h new file mode 100644 index 0000000..66a2c7e --- /dev/null +++ b/source/version.h @@ -0,0 +1,2 @@ +#pragma once +#define VERSION_EXTRA "" \ No newline at end of file