Fix versioning for release builds.

(cherry picked from commit 9019cbfd2b715c35da10ad7ed79d44ab81e57052)
This commit is contained in:
Dan Albert 2020-11-14 12:37:22 -08:00
parent e26e7f53c5
commit 4b40739918
2 changed files with 17 additions and 4 deletions

View File

@ -29,6 +29,10 @@ jobs:
# For some reason the shiboken2.abi3.dll is not found properly, so I copy it instead
Copy-Item .\venv\Lib\site-packages\shiboken2\shiboken2.abi3.dll .\venv\Lib\site-packages\PySide2\ -Force
- name: Finalize version
run: |
New-Item -ItemType file final
- name: mypy game
run: |
./venv/scripts/activate

View File

@ -1,8 +1,17 @@
from pathlib import Path
def _build_version_string() -> str:
components = ["2.2.0"]
if Path("buildnumber").exists():
with open("buildnumber", "r") as file:
components.append(file.readline())
if not Path("final").exists():
components.append("preview")
return "-".join(components)
#: Current version of Liberation.
VERSION = "2.2.0"
if Path("buildnumber").exists():
with open("buildnumber", "r") as file:
VERSION += f"-{file.readline()}"
VERSION = _build_version_string()