diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b4611a..f3dadee 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 < ./source/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 e3a37b7..11cc8d5 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 < ./source/version.h + #pragma once + #define VERSION_EXTRA " (nightly-$git_hash)" + EOF - name: build binary run: | docker build . -t builder diff --git a/source/globals.h b/source/globals.h index 165070d..1e9f06e 100644 --- a/source/globals.h +++ b/source/globals.h @@ -1,12 +1,16 @@ #pragma once #include "plugin/PluginContainer.h" #include "utils/ConfigUtils.h" +#include "version.h" #include #include #include #include #include +#define VERSION "v0.1" +#define VERSION_FULL VERSION VERSION_EXTRA + extern StoredBuffer gStoredTVBuffer; extern StoredBuffer gStoredDRCBuffer; diff --git a/source/utils/ConfigUtils.cpp b/source/utils/ConfigUtils.cpp index 5d6606a..08aedb4 100644 --- a/source/utils/ConfigUtils.cpp +++ b/source/utils/ConfigUtils.cpp @@ -262,7 +262,7 @@ void ConfigUtils::displayMenu() { DrawUtils::setFontSize(24); DrawUtils::print(16, 6 + 24, "Wii U Plugin System Config Menu"); DrawUtils::setFontSize(18); - DrawUtils::print(SCREEN_WIDTH - 16, 8 + 24, "v1.0", true); + DrawUtils::print(SCREEN_WIDTH - 16, 8 + 24, VERSION_FULL, true); DrawUtils::drawRectFilled(8, 8 + 24 + 4, SCREEN_WIDTH - 8 * 2, 3, COLOR_BLACK); // draw bottom bar 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