mirror of
https://github.com/aclist/dztui.git
synced 2026-08-26 09:47:36 +02:00
chore: update release script
This commit is contained in:
parent
8a66bafe4c
commit
3d2e27bfe1
@ -5,11 +5,12 @@ import tarfile
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from prebuild import get_pyapp, rebuild_cpython
|
||||
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
output = root.joinpath("dist")
|
||||
|
||||
pyapp_dir = root.joinpath("pyapp-latest")
|
||||
cpython = root.joinpath("build/cpython/airgapped.tar.gz")
|
||||
build_dir = root.joinpath("build")
|
||||
|
||||
builder = build.ProjectBuilder(root)
|
||||
wheel = builder.build("wheel", output_directory=output)
|
||||
@ -20,8 +21,15 @@ metadata = stem.split("-")
|
||||
appname = metadata[0]
|
||||
version = metadata[1]
|
||||
|
||||
entrypoint = "dzgui.main:main"
|
||||
pyapp_dir = build_dir.joinpath("pyapp-latest")
|
||||
if pyapp_dir.is_dir() is False:
|
||||
get_pyapp()
|
||||
|
||||
packaged_version = rebuild_cpython()
|
||||
assert packaged_version == version
|
||||
cpython = build_dir.joinpath("airgapped.tar.gz")
|
||||
|
||||
entrypoint = "dzgui.main:main"
|
||||
env = os.environ
|
||||
env["PYAPP_PROJECT_VERSION"] = version
|
||||
env["PYAPP_PROJECT_NAME"] = appname
|
||||
@ -38,7 +46,7 @@ env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3"
|
||||
|
||||
proc = subprocess.run(["cargo", "build", "--release"], env=env, cwd=pyapp_dir)
|
||||
if proc.returncode == 0:
|
||||
output_exe = root.joinpath("pyapp-latest/target/release/pyapp")
|
||||
output_exe = build_dir.joinpath("pyapp-latest/target/release/pyapp")
|
||||
release_exe = output.joinpath(appname)
|
||||
output_exe.rename(release_exe)
|
||||
tarpath = output.joinpath(tarname)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user