mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
refactor(release): clean up release build process
* handle case where a dist has never been created * ignore requirements.txt * include map resources instead of pulling from submodule
This commit is contained in:
parent
ea6b2ab2dc
commit
49795993f1
@ -3,38 +3,47 @@
|
|||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
|
|
||||||
a = Analysis(['__init__.py'],
|
analysis = Analysis(
|
||||||
pathex=['C:\\Users\\shdwp\\PycharmProjects\\dcs_liberation'],
|
['__init__.py'],
|
||||||
binaries=[],
|
pathex=['.'],
|
||||||
datas=[
|
binaries=[],
|
||||||
('resources', 'resources'),
|
datas=[
|
||||||
('submodules/dcs/dcs/terrain/caucasus.p', 'dcs/terrain/'),
|
('resources', 'resources'),
|
||||||
('submodules/dcs/dcs/terrain/nevada.p', 'dcs/terrain/'),
|
('resources/caucasus.p', 'dcs/terrain/'),
|
||||||
],
|
('resources/nevada.p', 'dcs/terrain/'),
|
||||||
hookspath=[],
|
],
|
||||||
runtime_hooks=[],
|
hookspath=[],
|
||||||
excludes=[],
|
runtime_hooks=[],
|
||||||
win_no_prefer_redirects=False,
|
excludes=[],
|
||||||
win_private_assemblies=False,
|
win_no_prefer_redirects=False,
|
||||||
cipher=block_cipher,
|
win_private_assemblies=False,
|
||||||
noarchive=False)
|
cipher=block_cipher,
|
||||||
pyz = PYZ(a.pure, a.zipped_data,
|
noarchive=False,
|
||||||
cipher=block_cipher)
|
)
|
||||||
exe = EXE(pyz,
|
pyz = PYZ(
|
||||||
a.scripts,
|
analysis.pure,
|
||||||
[],
|
analysis.zipped_data,
|
||||||
icon="resources/icon.ico",
|
cipher=block_cipher,
|
||||||
exclude_binaries=True,
|
)
|
||||||
name='liberation_main',
|
exe = EXE(
|
||||||
debug=False,
|
pyz,
|
||||||
bootloader_ignore_signals=False,
|
analysis.scripts,
|
||||||
strip=False,
|
[],
|
||||||
upx=True,
|
icon="resources/icon.ico",
|
||||||
console=True )
|
exclude_binaries=True,
|
||||||
coll = COLLECT(exe,
|
name='liberation_main',
|
||||||
a.binaries,
|
debug=False,
|
||||||
a.zipfiles,
|
bootloader_ignore_signals=False,
|
||||||
a.datas,
|
strip=False,
|
||||||
strip=False,
|
upx=True,
|
||||||
upx=True,
|
console=True,
|
||||||
name='dcs_liberation')
|
)
|
||||||
|
coll = COLLECT(
|
||||||
|
exe,
|
||||||
|
analysis.binaries,
|
||||||
|
analysis.zipfiles,
|
||||||
|
analysis.datas,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
name='dcs_liberation',
|
||||||
|
)
|
||||||
|
|||||||
BIN
resources/caucasus.p
Normal file
BIN
resources/caucasus.p
Normal file
Binary file not shown.
BIN
resources/nevada.p
Normal file
BIN
resources/nevada.p
Normal file
Binary file not shown.
@ -7,12 +7,10 @@ from zipfile import *
|
|||||||
IGNORED_PATHS = [
|
IGNORED_PATHS = [
|
||||||
"__pycache__",
|
"__pycache__",
|
||||||
".gitignore",
|
".gitignore",
|
||||||
".gitmodules",
|
|
||||||
".git",
|
".git",
|
||||||
".idea",
|
".idea",
|
||||||
".DS_Store",
|
".DS_Store",
|
||||||
"submodules",
|
"requirements.txt",
|
||||||
|
|
||||||
"build",
|
"build",
|
||||||
"venv",
|
"venv",
|
||||||
]
|
]
|
||||||
@ -38,18 +36,19 @@ def _zip_dir(archieve, path):
|
|||||||
|
|
||||||
|
|
||||||
def _mk_archieve():
|
def _mk_archieve():
|
||||||
path = os.path.join("build", "dcs_liberation_{}.zip".format(VERSION))
|
path = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "build", "dcs_liberation_{}.zip".format(VERSION))
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
print("version already exists")
|
print("version already exists")
|
||||||
return
|
return
|
||||||
|
|
||||||
shutil.rmtree("./dist")
|
try:
|
||||||
|
shutil.rmtree("./dist")
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
os.system("pyinstaller.exe pyinstaller.spec")
|
os.system("pyinstaller.exe pyinstaller.spec")
|
||||||
|
|
||||||
archieve = ZipFile(path, "w")
|
archieve = ZipFile(path, "w")
|
||||||
archieve.writestr("dcs_liberation.bat", "cd dist\\dcs_liberation\r\nliberation_main \"%UserProfile%\\Saved Games\" \"{}\"".format(VERSION))
|
archieve.writestr("dcs_liberation.bat", "cd dist\\dcs_liberation\r\nliberation_main \"%UserProfile%\\Saved Games\" \"{}\"".format(VERSION))
|
||||||
_zip_dir(archieve, "./dist/dcs_liberation")
|
_zip_dir(archieve, "./dist/dcs_liberation")
|
||||||
|
|
||||||
|
|
||||||
_mk_archieve()
|
_mk_archieve()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user