Skip to content

Commit 87e02a9

Browse files
committed
Update version string using git tag
1 parent df1832f commit 87e02a9

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
with:
3434
path: MultiAddonManager
3535
submodules: recursive
36+
fetch-depth: 0
3637

3738
- name: Checkout Metamod
3839
uses: actions/checkout@v4

AMBuilder

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
22
import os
3+
import subprocess
34

45
MMSPlugin.plugin_name = 'multiaddonmanager'
56
MMSPlugin.plugin_alias = 'multiaddonmanager'
@@ -14,6 +15,9 @@ for sdk_target in MMSPlugin.sdk_targets:
1415
cxx = sdk_target.cxx
1516

1617
binary = MMSPlugin.HL2Library(builder, cxx, MMSPlugin.plugin_name, sdk)
18+
19+
version = subprocess.check_output(['git', 'describe', '--tags', '--long']).decode('ascii').strip()
20+
binary.compiler.defines += ['MULTIADDONMANAGER_VERSION="%s"'%(version)]
1721

1822
target_folder = 'Debug' if builder.options.debug else 'Release'
1923

src/multiaddonmanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ const char *MultiAddonManager::GetLicense()
773773

774774
const char *MultiAddonManager::GetVersion()
775775
{
776-
return "1.2.4";
776+
return MULTIADDONMANAGER_VERSION; // defined by the build script
777777
}
778778

779779
const char *MultiAddonManager::GetDate()

0 commit comments

Comments
 (0)