Merge pull request #2 from Neintonine/develop

improved build
This commit is contained in:
Michel Fedde 2024-01-29 22:13:28 +01:00 committed by GitHub
commit 2a57537868
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 3 deletions

View file

@ -1 +1 @@
1.0.0+build.1 1.0.0+build.5

View file

@ -1,9 +1,11 @@
import os import os
import shutil import shutil
import zipfile
import versioning import versioning
ZIP_FILE_NAME = "blender_bake-id-mask_{version}" ZIP_FILE_NAME = "blender_bake-id-mask_{version}.zip"
PROJECT_NAME = "Bake ID Mask"
CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
@ -20,4 +22,19 @@ if __name__ == "__main__":
versioning.save_version(nextVersion) versioning.save_version(nextVersion)
filename = os.path.join(TARGET_PATH, ZIP_FILE_NAME.format(version=nextVersion.__str__())) filename = os.path.join(TARGET_PATH, ZIP_FILE_NAME.format(version=nextVersion.__str__()))
shutil.make_archive(filename, 'zip', SOURCE_PATH) with zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED) as zip:
for (root, dirs, files) in os.walk(SOURCE_PATH):
if '__pycache__' in dirs:
dirs.remove('__pycache__')
for file in files:
relativePath = os.path.relpath(
os.path.join(root, file),
SOURCE_PATH
)
zip.write(
os.path.join(root, file),
os.path.join(PROJECT_NAME, relativePath)
)