Skip to content

Commit 344720e

Browse files
committed
update
1 parent 1a1b20e commit 344720e

File tree

3 files changed

+36
-63
lines changed

3 files changed

+36
-63
lines changed

.github/workflows/release_nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
env:
6060
CUDA_VERSION: ${{ matrix.cuda-version }}
6161
CIBW_SKIP: "cp39* cp314* cp3??t-* *musllinux*"
62+
NO_VERSION_LABEL: 1
6263

6364
- name: Upload wheels as artifacts
6465
uses: actions/upload-artifact@v4

get_verison.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
pattern = re.compile(
66
r"tilelang-"
7-
r"((\d+\.)+\d+(?:\.post\d+)?)"
8-
r"\+cu(\d+)\."
9-
r"git([a-z0-9]+)?"
7+
r"((\d+\.)+\d+(?:\.post\d+)?)"
108
)
119

1210
path = next(pathlib.Path("dist").glob("*.whl"))

update_whl_index.py

Lines changed: 34 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,54 @@
11
import hashlib
22
import pathlib
3-
import re
43
import argparse
5-
import os
64

75
parser = argparse.ArgumentParser()
86
parser.add_argument("--mode", type=str, default="nightly")
97
args = parser.parse_args()
108
base_url = "https://github.com/tile-ai/tilelang-nightly/releases/download"
11-
pattern = re.compile(
12-
r"tilelang-"
13-
r"((\d+\.)+\d+(?:\.post\d+)?)"
14-
r"\+cu(\d+)\."
15-
r"git([a-z0-9]+)?"
16-
)
179
base_path = "tilelang-whl/nightly"
1810
vvver = " Nightly"
19-
star = "*"
2011

2112
if args.mode != "nightly":
2213
vvver = ""
2314
base_path = "tilelang-whl"
2415
base_url = "https://github.com/tile-ai/tilelang/releases/download"
25-
star = "cu*"
26-
if args.mode == "nightly":
27-
with (pathlib.Path(base_path) / "index.html").open("w") as f:
28-
f.write(
29-
"""<!DOCTYPE html>
30-
<h1>TileLang Nightly Python Wheels</h1>\n"""
31-
)
32-
for index_dir in pathlib.Path(base_path).glob(star):
33-
if index_dir.is_dir():
34-
os.system(f"rm -rf {index_dir}")
35-
dir_set = set()
36-
cuda_versions = list(range(121, 129))
37-
for path in sorted(pathlib.Path("dist").glob("*.whl")):
38-
with open(path, "rb") as f:
39-
sha256 = hashlib.sha256(f.read()).hexdigest()
4016

41-
with open("version", "r") as f:
42-
full_version = f.read()
17+
index_dir = pathlib.Path(base_path)
18+
index_dir.mkdir(parents=True, exist_ok=True)
19+
20+
with (index_dir / "index.html").open("w") as f:
21+
f.write(
22+
f"""<!DOCTYPE html>
23+
<h1>TileLang{vvver} Python Wheels</h1>\n"""
24+
)
25+
26+
for path in sorted(pathlib.Path("dist").glob("*.whl")):
27+
with open(path, "rb") as f:
28+
sha256 = hashlib.sha256(f.read()).hexdigest()
4329

44-
for cuda_version in cuda_versions:
45-
index_dir = pathlib.Path(f"{base_path}/cu{cuda_version}")
46-
index_dir.mkdir(exist_ok=True)
47-
ver = full_version.replace("+", "%2B")
48-
if args.mode != "nightly":
49-
ver = 'v' + ver
50-
full_url = f"{base_url}/{ver}/{path.name}#sha256={sha256}"
51-
if cuda_version not in dir_set:
52-
with (index_dir / "index.html").open("w") as f:
53-
f.write(
54-
f"""<!DOCTYPE html>
55-
<h1>TileLang{vvver} Python Wheels for CUDA {cuda_version}</h1>\n"""
56-
)
57-
with (pathlib.Path(base_path) / "index.html").open("a+") as f:
58-
f.write(
59-
f'<a href="cu{cuda_version}/">cu{cuda_version}</a><br>'
60-
)
61-
dir_set.add(cuda_version)
62-
with (index_dir / "index.html").open("a") as f:
63-
f.write(f'<a href="{full_url}">{path.name}</a><br>\n')
64-
break
30+
with open("version", "r") as f:
31+
full_version = f.read()
6532

66-
dir_list = []
33+
ver = full_version.replace("+", "%2B")
34+
if args.mode != "nightly":
35+
ver = 'v' + ver
36+
full_url = f"{base_url}/{ver}/{path.name}#sha256={sha256}"
37+
with (index_dir / "index.html").open("a") as f:
38+
f.write(f'<a href="{full_url}">{path.name}</a><br>\n')
39+
break
6740

68-
for index_dir in pathlib.Path("tilelang-whl").iterdir():
69-
if index_dir.is_dir():
70-
if index_dir.name[0] != '.':
71-
dir_list.append(index_dir.name)
72-
dir_list.sort()
73-
with (pathlib.Path("tilelang-whl") / "index.html").open("w") as f:
74-
f.write(
75-
"""<!DOCTYPE html>
41+
if args.mode == "nightly":
42+
dir_list = []
43+
for d in pathlib.Path("tilelang-whl").iterdir():
44+
if d.is_dir() and not d.name.startswith('.'):
45+
dir_list.append(d.name)
46+
dir_list.sort()
47+
with (pathlib.Path("tilelang-whl") / "index.html").open("w") as f:
48+
f.write(
49+
"""<!DOCTYPE html>
7650
<h1>TileLang Python Wheels</h1>\n"""
77-
)
78-
for dir_name in dir_list:
79-
with (pathlib.Path("tilelang-whl") / "index.html").open("a") as f:
80-
f.write(f'<a href="{dir_name}/">{dir_name}</a><br>\n')
51+
)
52+
for dir_name in dir_list:
53+
with (pathlib.Path("tilelang-whl") / "index.html").open("a") as f:
54+
f.write(f'<a href="{dir_name}/">{dir_name}</a><br>\n')

0 commit comments

Comments
 (0)