-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_release.py
56 lines (47 loc) · 1.92 KB
/
build_release.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
VERSION = "1.3"
builds = [
("x86", "windows", "i386", None),
("x86_64", "windows", "x86_64", None),
("x86_64", "windows", "x86_64", "x86_64_v2"),
("x86_64", "windows", "x86_64", "x86_64_v3"),
("x86_64", "windows", "x86_64", "x86_64_v4"),
("x86_64", "windows", "x86_64", "znver1"),
("x86_64", "windows", "x86_64", "znver2"),
("x86_64", "windows", "x86_64", "znver3"),
("x86_64", "windows", "x86_64", "znver4"),
("x86_64", "windows", "x86_64", "znver5"),
("aarch64", "windows", "aarch64", None),
("x86", "linux", "i386", None),
("x86_64", "linux", "x86_64", None),
("x86_64", "linux", "x86_64", "x86_64_v2"),
("x86_64", "linux", "x86_64", "x86_64_v3"),
("x86_64", "linux", "x86_64", "x86_64_v4"),
("x86_64", "linux", "x86_64", "znver1"),
("x86_64", "linux", "x86_64", "znver2"),
("x86_64", "linux", "x86_64", "znver3"),
("x86_64", "linux", "x86_64", "znver4"),
("x86_64", "linux", "x86_64", "znver5"),
("aarch64", "linux", "aarch64", None),
("x86_64", "macos", "x86_64", None),
("aarch64", "macos", "aarch64", None),
]
commands = []
for arch, os_name, zig_arch, cpu in builds:
cpu_flag = f"-Dcpu={cpu} " if cpu else ""
if cpu is not None:
if cpu.startswith(arch):
output_name_base = f"pawnocchio-{VERSION}-{os_name}-{cpu}"
else:
output_name_base = f"pawnocchio-{VERSION}-{os_name}-{arch}_{cpu}"
else:
output_name_base = f"pawnocchio-{VERSION}-{os_name}-{arch}"
output_name = output_name_base + (".exe" if os_name == "windows" else "")
build_cmd = f"zig build --release=fast {cpu_flag}-Dtarget={arch}-{os_name} -Dname={output_name_base}"
move_cmd = f"mv zig-out/bin/{output_name} builds/{output_name}"
commands.append(build_cmd + " && " + move_cmd)
# for command in commands:
# os.system(command + "&")
# os.system("wait")
for command in commands:
os.system(command)