Fix pyinstaller spec for release.

final and buildnumber are optional files. Move them into resources to
avoid naming them explicitly.

(cherry picked from commit fae9650f56854bb3f3508ee5b2625bba8e7ad2f8)
This commit is contained in:
Dan Albert 2020-11-14 13:01:11 -08:00
parent fad132dcca
commit 96c401e1b9
4 changed files with 7 additions and 7 deletions

View File

@ -44,7 +44,7 @@ jobs:
- name: update build number
run: |
[IO.File]::WriteAllLines($pwd.path + "\buildnumber", $env:GITHUB_RUN_NUMBER)
[IO.File]::WriteAllLines($pwd.path + "\resources\buildnumber", $env:GITHUB_RUN_NUMBER)
- name: Build binaries
run: |

View File

@ -31,7 +31,7 @@ jobs:
- name: Finalize version
run: |
New-Item -ItemType file final
New-Item -ItemType file resources\final
- name: mypy game
run: |

View File

@ -3,11 +3,12 @@ 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())
build_number_path = Path("resources/buildnumber")
if build_number_path.exists():
with build_number_path.open("r") as build_number_file:
components.append(build_number_file.readline())
if not Path("final").exists():
if not Path("resources/final").exists():
components.append("preview")
return "-".join(components)

View File

@ -11,7 +11,6 @@ analysis = Analysis(
('resources', 'resources'),
('resources/caucasus.p', 'dcs/terrain/'),
('resources/nevada.p', 'dcs/terrain/'),
('buildnumber', './')
],
hookspath=[],
runtime_hooks=[],