mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
chore: build musl release target
This commit is contained in:
1 parent
8eb0a17b78
commit
fa486c2b76
1 file changed
+12
-4
+12
-4
@@ -4,10 +4,8 @@ import subprocess
|
|||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from prebuild import get_pyapp, rebuild_cpython
|
from prebuild import get_pyapp, rebuild_cpython
|
||||||
|
|
||||||
|
|
||||||
root = Path(__file__).resolve().parents[1]
|
root = Path(__file__).resolve().parents[1]
|
||||||
output = root.joinpath("dist")
|
output = root.joinpath("dist")
|
||||||
build_dir = root.joinpath("build")
|
build_dir = root.joinpath("build")
|
||||||
@@ -17,6 +15,7 @@ wheel = builder.build("wheel", output_directory=output)
|
|||||||
stem = Path(wheel).stem
|
stem = Path(wheel).stem
|
||||||
tarname = f"{stem}.tar.gz"
|
tarname = f"{stem}.tar.gz"
|
||||||
|
|
||||||
|
|
||||||
metadata = stem.split("-")
|
metadata = stem.split("-")
|
||||||
appname = metadata[0]
|
appname = metadata[0]
|
||||||
version = metadata[1]
|
version = metadata[1]
|
||||||
@@ -44,9 +43,18 @@ env["PYAPP_FULL_ISOLATION"] = "true"
|
|||||||
env["PYAPP_DISTRIBUTION_PATH"] = str(cpython)
|
env["PYAPP_DISTRIBUTION_PATH"] = str(cpython)
|
||||||
env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3"
|
env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3"
|
||||||
|
|
||||||
proc = subprocess.run(["cargo", "build", "--release"], env=env, cwd=pyapp_dir)
|
target = "x86_64-unknown-linux-musl"
|
||||||
|
build_params = [ "cargo", "build", "--release", "--target", target]
|
||||||
|
|
||||||
|
proc = subprocess.run(
|
||||||
|
build_params,
|
||||||
|
env=env,
|
||||||
|
cwd=pyapp_dir,
|
||||||
|
)
|
||||||
|
|
||||||
|
# TODO: set proper release tags on tarfile
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
output_exe = build_dir.joinpath("pyapp-latest/target/release/pyapp")
|
output_exe = build_dir.joinpath(f"pyapp-latest/target/{target}/release/pyapp")
|
||||||
release_exe = output.joinpath(appname)
|
release_exe = output.joinpath(appname)
|
||||||
output_exe.rename(release_exe)
|
output_exe.rename(release_exe)
|
||||||
tarpath = output.joinpath(tarname)
|
tarpath = output.joinpath(tarname)
|
||||||
|
|||||||
Reference in new issue
Block a user