diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b07f425c..29d80ab5 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -31,6 +31,15 @@ jobs:
- name: Build dependencies
run: deps\build.bat --machine ${{matrix.arch}}
+ - name: Put git commit hash in version value
+ run: |
+ (
+ Get-Content -Path src\taiga\config.h
+ ) -Replace (
+ "(?<=#define TAIGA_VERSION_BUILD 0x).*",
+ (git rev-parse --short HEAD)
+ ) | Set-Content -Path src\taiga\config.h
+
- name: Build Taiga
run: msbuild "project\vs2022\Taiga.sln" /m /p:Configuration=Release /p:Platform=${{matrix.arch}}
diff --git a/src/taiga/config.h b/src/taiga/config.h
index 56a985da..438300a5 100644
--- a/src/taiga/config.h
+++ b/src/taiga/config.h
@@ -34,7 +34,7 @@
#define TAIGA_VERSION_MINOR 4
#define TAIGA_VERSION_PATCH 0
#define TAIGA_VERSION_PRE "beta.2"
-#define TAIGA_VERSION_BUILD 0
+#define TAIGA_VERSION_BUILD 0x0
// Used in version.rc
#define TAIGA_VERSION_DIGITAL \
diff --git a/src/taiga/version.cpp b/src/taiga/version.cpp
index 9f512eaf..af71d53e 100644
--- a/src/taiga/version.cpp
+++ b/src/taiga/version.cpp
@@ -16,6 +16,8 @@
** along with this program. If not, see .
*/
+#include
+
#include "taiga/version.h"
#include "base/preprocessor.h"
@@ -29,7 +31,7 @@ const semaver::Version& version() {
TAIGA_VERSION_MINOR,
TAIGA_VERSION_PATCH,
TAIGA_VERSION_PRE,
- TAIGA_VERSION_BUILD > 0 ? STRINGIZE(TAIGA_VERSION_BUILD) : ""
+ TAIGA_VERSION_BUILD == 0 ? "" : fmt::format("{:x}", TAIGA_VERSION_BUILD)
);
return version;
}