diff --git a/scripts/release.py b/scripts/release.py index df6a56a..1d0b45c 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -10,11 +10,13 @@ from concat_licenses import concat_license from parse_toml import get_entrypoint from prebuild import get_pyapp, rebuild_cpython + def update_uname(info: tarfile.TarInfo) -> tarfile.TarInfo: info.uname = "dzgui" info.gname = "users" return info + root = Path(__file__).resolve().parents[1] dist_dir = root.joinpath("dist") build_dir = root.joinpath("build") @@ -52,7 +54,8 @@ env["PYAPP_DISTRIBUTION_PATH"] = str(cpython) env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3" platform = "x86_64-unknown-linux-musl" -tarname = f"{appname}-{platform}.tar.gz" +build_name = f"{appname}-{version}-{platform}" +tarname = f"{build_name}.tar.gz" tarpath = dist_dir.joinpath(tarname) build_params = [ @@ -74,13 +77,13 @@ proc = subprocess.run( if proc.returncode != 0: sys.exit(1) -output_exe = dist_dir.joinpath("pyapp") -release_exe = dist_dir.joinpath(appname) -output_exe.rename(release_exe) - -subfolder = output.joinpath(stem) +subfolder = dist_dir.joinpath(build_name) subfolder.mkdir(parents=True) +output_exe = dist_dir.joinpath("pyapp") +release_exe = subfolder.joinpath(appname) +output_exe.rename(release_exe) + combined_licenses = concat_license() license_file = subfolder.joinpath("LICENSE") license_file.write_text(combined_licenses) @@ -97,4 +100,4 @@ assert proc.stdout.rstrip() == version release_exe.unlink() license_file.unlink() subfolder.rmdir() -Path(wheel).unlink() \ No newline at end of file +Path(wheel).unlink()