diff --git a/scripts/packaging/win/build_version.py b/scripts/packaging/win/build_version.py index 5f075bef0c..171b9d917c 100644 --- a/scripts/packaging/win/build_version.py +++ b/scripts/packaging/win/build_version.py @@ -1,10 +1,21 @@ -from time import time - from snowflake.cli.__about__ import VERSION -if len(version := VERSION.split(".")) > 3: - version[-1] = str(int(time())) -else: - version.append("0") -print(".".join(version)) +def parse_version_for_windows_build() -> list[str]: + version = VERSION.split(".") + *msv, last = version + + match last: + case last if last.isdigit(): + version.append("0") + case last if "rc" in last: + version = msv + last.split("rc") + case last if "dev" in last: + version = msv + last.split("dev") + + return version + + +if __name__ == "__main__": + version = parse_version_for_windows_build() + print(".".join(version))