From 8988ffc26266948ed78b804b7997681b8bdb4be8 Mon Sep 17 00:00:00 2001
From: autumn <34-paradoxical_autumn@users.noreply.gitlab.1024cats.social>
Date: Tue, 17 Feb 2026 22:35:26 +0000
Subject: [PATCH] fix #1 - make build script timestamps hard coded and make
versioning use the Version tag
i thought this would be difficult and require XML parsing. i guess i was right when i said "command line arguments"
---
mc-manager/BUILD.py | 19 +++++++++++++++++--
mc-manager/mc-manager.csproj | 2 +-
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/mc-manager/BUILD.py b/mc-manager/BUILD.py
index 5b0c0d2..088e0b8 100644
--- a/mc-manager/BUILD.py
+++ b/mc-manager/BUILD.py
@@ -1,6 +1,6 @@
#!/usr/bin/python3
-import os
+import os, datetime
RIDS = [
"linux-x64",
@@ -11,11 +11,26 @@ RIDS = [
"win-arm64"
]
+def get_timestamp():
+ # Yep. We're emulating a bug where our autogenerated timestamps do not have leading zeros
+ # even though it would be semantically correct to prepend them.
+ # This has been a bug since the software was created and now we need to keep it,
+ # lest we break any end user's automatic updating script.
+ now = datetime.datetime.now(datetime.timezone.utc)
+
+ year = now.strftime("%Y")
+ month_day = int(now.strftime("%m%d"))
+ hour_min = int(now.strftime("%H%M"))
+
+ return f"{year}.{month_day}.{hour_min}"
+
+CURRENT_TIMESTAMP = get_timestamp()
+
for rid in RIDS:
target_os, arch = rid.split("-")
print(f"=> BUILDING: {rid}")
- ret = os.system(rf"dotnet publish --sc true --os {target_os} --arch {arch} -o ./pub/{rid}")
+ ret = os.system(rf"dotnet publish --sc true --os {target_os} --arch {arch} -p:Version={CURRENT_TIMESTAMP} -o ./pub/{rid}")
if ret != 0:
raise OSError("Build error")
diff --git a/mc-manager/mc-manager.csproj b/mc-manager/mc-manager.csproj
index 06adf4b..0a58984 100644
--- a/mc-manager/mc-manager.csproj
+++ b/mc-manager/mc-manager.csproj
@@ -7,7 +7,7 @@
enable
enable
- $([System.DateTime]::UtcNow.ToString("yyyy.MMdd.HHmm"))
+ $([System.DateTime]::UtcNow.ToString("yyyy.MMdd.HHmm"))