Fix release script. (#8187)
This commit is contained in:
parent
0fd6391a77
commit
1fbb4524d2
@ -75,7 +75,7 @@ def download_wheels(
|
|||||||
return filenames
|
return filenames
|
||||||
|
|
||||||
|
|
||||||
def download_py_packages(major: int, minor: int, commit_hash: str):
|
def download_py_packages(branch: str, major: int, minor: int, commit_hash: str) -> None:
|
||||||
platforms = [
|
platforms = [
|
||||||
"win_amd64",
|
"win_amd64",
|
||||||
"manylinux2014_x86_64",
|
"manylinux2014_x86_64",
|
||||||
@ -84,7 +84,8 @@ def download_py_packages(major: int, minor: int, commit_hash: str):
|
|||||||
"macosx_12_0_arm64"
|
"macosx_12_0_arm64"
|
||||||
]
|
]
|
||||||
|
|
||||||
dir_URL = PREFIX + str(major) + "." + str(minor) + ".0" + "/"
|
branch = branch.split("_")[1] # release_x.y.z
|
||||||
|
dir_URL = PREFIX + branch + "/"
|
||||||
src_filename_prefix = "xgboost-" + args.release + "%2B" + commit_hash + "-py3-none-"
|
src_filename_prefix = "xgboost-" + args.release + "%2B" + commit_hash + "-py3-none-"
|
||||||
target_filename_prefix = "xgboost-" + args.release + "-py3-none-"
|
target_filename_prefix = "xgboost-" + args.release + "-py3-none-"
|
||||||
|
|
||||||
@ -105,16 +106,17 @@ Following steps should be done manually:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def download_r_packages(release: str, rc: str, commit: str) -> None:
|
def download_r_packages(release: str, branch: str, rc: str, commit: str) -> None:
|
||||||
platforms = ["win64", "linux"]
|
platforms = ["win64", "linux"]
|
||||||
dirname = "./r-packages"
|
dirname = "./r-packages"
|
||||||
if not os.path.exists(dirname):
|
if not os.path.exists(dirname):
|
||||||
os.mkdir(dirname)
|
os.mkdir(dirname)
|
||||||
|
|
||||||
filenames = []
|
filenames = []
|
||||||
|
branch = branch.split("_")[1] # release_x.y.z
|
||||||
|
|
||||||
for plat in platforms:
|
for plat in platforms:
|
||||||
url = f"{PREFIX}{release}/xgboost_r_gpu_{plat}_{commit}.tar.gz"
|
url = f"{PREFIX}{branch}/xgboost_r_gpu_{plat}_{commit}.tar.gz"
|
||||||
|
|
||||||
if not rc:
|
if not rc:
|
||||||
filename = f"xgboost_r_gpu_{plat}_{release}.tar.gz"
|
filename = f"xgboost_r_gpu_{plat}_{release}.tar.gz"
|
||||||
@ -152,7 +154,11 @@ def main(args: argparse.Namespace) -> None:
|
|||||||
assert rc == "rc"
|
assert rc == "rc"
|
||||||
|
|
||||||
release = str(major) + "." + str(minor) + "." + str(patch)
|
release = str(major) + "." + str(minor) + "." + str(patch)
|
||||||
branch = "release_" + release
|
if args.branch is not None:
|
||||||
|
branch = args.branch
|
||||||
|
else:
|
||||||
|
branch = "release_" + str(major) + "." + str(minor) + ".0"
|
||||||
|
|
||||||
git.clean("-xdf")
|
git.clean("-xdf")
|
||||||
git.checkout(branch)
|
git.checkout(branch)
|
||||||
git.pull("origin", branch)
|
git.pull("origin", branch)
|
||||||
@ -160,10 +166,10 @@ def main(args: argparse.Namespace) -> None:
|
|||||||
commit_hash = latest_hash()
|
commit_hash = latest_hash()
|
||||||
|
|
||||||
download_r_packages(
|
download_r_packages(
|
||||||
release, "" if rc is None else rc + str(rc_ver), commit_hash
|
release, branch, "" if rc is None else rc + str(rc_ver), commit_hash
|
||||||
)
|
)
|
||||||
|
|
||||||
download_py_packages(major, minor, commit_hash)
|
download_py_packages(branch, major, minor, commit_hash)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@ -174,5 +180,14 @@ if __name__ == "__main__":
|
|||||||
required=True,
|
required=True,
|
||||||
help="Version tag, e.g. '1.3.2', or '1.5.0rc1'"
|
help="Version tag, e.g. '1.3.2', or '1.5.0rc1'"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--branch",
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
help=(
|
||||||
|
"Optional branch. Usually patch releases reuse the same branch of the"
|
||||||
|
" major release, but there can be exception."
|
||||||
|
)
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
main(args)
|
main(args)
|
||||||
|
|||||||
@ -18,6 +18,8 @@ recursive-include xgboost/include *
|
|||||||
recursive-include xgboost/plugin *
|
recursive-include xgboost/plugin *
|
||||||
recursive-include xgboost/src *
|
recursive-include xgboost/src *
|
||||||
|
|
||||||
|
recursive-include xgboost/gputreeshap/GPUTreeshap *
|
||||||
|
|
||||||
include xgboost/rabit/CMakeLists.txt
|
include xgboost/rabit/CMakeLists.txt
|
||||||
recursive-include xgboost/rabit/include *
|
recursive-include xgboost/rabit/include *
|
||||||
recursive-include xgboost/rabit/src *
|
recursive-include xgboost/rabit/src *
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user