mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
ci: build Windows wheels for deltachat-rpc-server
This commit is contained in:
@@ -98,12 +98,22 @@ setup(
|
|||||||
pack("src/deltachat_rpc_server/__init__.py", "")
|
pack("src/deltachat_rpc_server/__init__.py", "")
|
||||||
|
|
||||||
|
|
||||||
def build_wheel(version, binary, tag):
|
def build_wheel(version, binary, tag, windows=False):
|
||||||
filename = f"dist/deltachat_rpc_server-{version}-{tag}.whl"
|
filename = f"dist/deltachat_rpc_server-{version}-{tag}.whl"
|
||||||
|
|
||||||
with WheelFile(filename, "w") as wheel:
|
with WheelFile(filename, "w") as wheel:
|
||||||
wheel.write("LICENSE", "deltachat_rpc_server/LICENSE")
|
wheel.write("LICENSE", "deltachat_rpc_server/LICENSE")
|
||||||
wheel.write("deltachat-rpc-server/README.md", "deltachat_rpc_server/README.md")
|
wheel.write("deltachat-rpc-server/README.md", "deltachat_rpc_server/README.md")
|
||||||
|
if windows:
|
||||||
|
wheel.writestr(
|
||||||
|
"deltachat_rpc_server/__init__.py",
|
||||||
|
"""import os, sys, subprocess
|
||||||
|
def main():
|
||||||
|
argv = [os.path.join(os.path.dirname(__file__), "deltachat-rpc-server.exe"), *sys.argv[1:]]
|
||||||
|
sys.exit(subprocess.call(argv))
|
||||||
|
""",
|
||||||
|
)
|
||||||
|
else:
|
||||||
wheel.writestr(
|
wheel.writestr(
|
||||||
"deltachat_rpc_server/__init__.py",
|
"deltachat_rpc_server/__init__.py",
|
||||||
"""import os, sys
|
"""import os, sys
|
||||||
@@ -116,7 +126,9 @@ def main():
|
|||||||
Path(binary).chmod(0o755)
|
Path(binary).chmod(0o755)
|
||||||
wheel.write(
|
wheel.write(
|
||||||
binary,
|
binary,
|
||||||
"deltachat_rpc_server/deltachat-rpc-server",
|
"deltachat_rpc_server/deltachat-rpc-server.exe"
|
||||||
|
if windows
|
||||||
|
else "deltachat_rpc_server/deltachat-rpc-server",
|
||||||
)
|
)
|
||||||
wheel.writestr(
|
wheel.writestr(
|
||||||
f"deltachat_rpc_server-{version}.dist-info/METADATA",
|
f"deltachat_rpc_server-{version}.dist-info/METADATA",
|
||||||
@@ -171,5 +183,15 @@ def main():
|
|||||||
"py3-none-macosx_11_0_arm64",
|
"py3-none-macosx_11_0_arm64",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
build_wheel(
|
||||||
|
version, "dist/deltachat-rpc-server-win32.exe", "py3-none-win32", windows=True
|
||||||
|
)
|
||||||
|
build_wheel(
|
||||||
|
version,
|
||||||
|
"dist/deltachat-rpc-server-win64.exe",
|
||||||
|
"py3-none-win_amd64",
|
||||||
|
windows=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user