mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-11-04 15:39:42 +08:00
ci(ci-binaries): fix manifest formatting
This commit is contained in:
parent
42ef85a5e8
commit
cd9eea64cd
2
ESP/.gitignore
vendored
2
ESP/.gitignore
vendored
@ -4,4 +4,4 @@ build/
|
|||||||
*.log
|
*.log
|
||||||
/tools/firmware_name.txt
|
/tools/firmware_name.txt
|
||||||
/tools/version.txt
|
/tools/version.txt
|
||||||
/tools/_pycache_/
|
/tools/__pycache__/
|
||||||
|
|||||||
@ -38,25 +38,17 @@ def createZip(source, target, env):
|
|||||||
str(env["PIOENV"]), env["PROGNAME"]
|
str(env["PIOENV"]), env["PROGNAME"]
|
||||||
)
|
)
|
||||||
|
|
||||||
my_flags = env.ParseFlags(env["BUILD_FLAGS"])
|
|
||||||
defines = dict()
|
|
||||||
for x in my_flags.get("CPPDEFINES"):
|
|
||||||
if type(x) is tuple:
|
|
||||||
(k, v) = x
|
|
||||||
defines[k] = v
|
|
||||||
elif type(x) is list:
|
|
||||||
k = x[0]
|
|
||||||
v = x[1]
|
|
||||||
defines[k] = v
|
|
||||||
else:
|
|
||||||
defines[x] = "" # empty value
|
|
||||||
|
|
||||||
with ZipFile(file_name, "w") as archive:
|
with ZipFile(file_name, "w") as archive:
|
||||||
print('\nCreating "' + archive.filename + '"', end="\n")
|
print('\nCreating "' + archive.filename + '"', end="\n")
|
||||||
parts = []
|
parts = []
|
||||||
|
|
||||||
|
# parse version from the PROGNAME
|
||||||
|
# version is the second part of the PROGNAME
|
||||||
|
# PROGNAME = OpenIris-v1.3.0-esp32AIThinker-8229a3a-master
|
||||||
|
# version = v1.3.0
|
||||||
|
|
||||||
name = "OpenIris"
|
name = "OpenIris"
|
||||||
version = str(defines.get("PIO_SRC_TAG"))
|
version = env["PROGNAME"].split("-")[1]
|
||||||
new_install_prompt_erase = True
|
new_install_prompt_erase = True
|
||||||
|
|
||||||
print("Creating manifest.json")
|
print("Creating manifest.json")
|
||||||
@ -92,15 +84,15 @@ def createZip(source, target, env):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
manifest = {
|
manifest = {
|
||||||
|
"name": name,
|
||||||
|
"version": version,
|
||||||
|
"new_install_prompt_erase": new_install_prompt_erase,
|
||||||
"builds": [
|
"builds": [
|
||||||
{
|
{
|
||||||
"name": name,
|
|
||||||
"version": version,
|
|
||||||
"new_install_prompt_erase": new_install_prompt_erase,
|
|
||||||
"chipFamily": "ESP32",
|
"chipFamily": "ESP32",
|
||||||
"parts": parts,
|
"parts": parts,
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
archive.writestr("manifest.json", json.dumps(manifest))
|
archive.writestr("manifest.json", json.dumps(manifest))
|
||||||
sys.stdout.write(RESET)
|
sys.stdout.write(RESET)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user