-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.py
34 lines (25 loc) · 978 Bytes
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (C) 2023 Wildfire Games.
# This file is part of 0 A.D.
# SPDX-License-Identifier: GPL-2.0-or-later
import os
try:
import tomllib
except ModuleNotFoundError:
import pip._vendor.tomli as tomllib
import zipfile
def get_version():
with open("io_scene_pyrogenesis/blender_manifest.toml", "rb") as f:
manifest = tomllib.load(f)
return manifest["version"]
def build_archive():
os.makedirs("dist", exist_ok=True)
with zipfile.ZipFile(
os.path.join("dist", "io_scene_pyrogenesis-" + get_version() + ".zip"), mode="w"
) as archive:
archive.write("io_scene_pyrogenesis/__init__.py")
archive.write("io_scene_pyrogenesis/max_collada_fixer.py")
archive.write("io_scene_pyrogenesis/import_pyrogenesis_actor.py")
archive.write("io_scene_pyrogenesis/blender_manifest.toml")
archive.write("LICENSE", arcname="io_scene_pyrogenesis/LICENSE")
if __name__ == "__main__":
build_archive()