Skip to content

Commit

Permalink
Fix versioning for release builds.
Browse files Browse the repository at this point in the history
(cherry picked from commit 9019cbf)
  • Loading branch information
DanAlbert committed Nov 14, 2020
1 parent 696710b commit fad132d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 13 additions & 4 deletions game/version.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit fad132d

Please sign in to comment.