chore: 官网拆分 homepage + 关于页瘦身 + 端口 5175(当前可用状态基线)
This commit is contained in:
1 parent
5eb11826db
commit
be151cb68f
85 files changed
+4420
-1530
No files matched your search
+35
-14
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create an OpsXShell Gitee Release and upload native installers.
|
||||
|
||||
The script is intentionally non-destructive: release artifacts stay in the
|
||||
local ``release/`` directory after a successful upload.
|
||||
The script is intentionally non-destructive: artifacts stay in Tauri's
|
||||
``src-tauri/target/<triple>/release/bundle/`` after a successful upload.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -74,23 +74,44 @@ def load_token() -> str:
|
||||
fail("缺少 Gitee Token:请设置 GITEE_TOKEN 或 ~/.netrc 的 gitee.com password")
|
||||
|
||||
|
||||
def collect_assets(root: Path, version: str) -> list[Path]:
|
||||
version_dir = root / "release" / version
|
||||
if not version_dir.is_dir():
|
||||
fail(f"发布目录不存在:{version_dir}")
|
||||
TAURI_BUNDLE_ROOTS = (
|
||||
"src-tauri/target/release/bundle",
|
||||
"src-tauri/target/aarch64-apple-darwin/release/bundle",
|
||||
"src-tauri/target/x86_64-apple-darwin/release/bundle",
|
||||
"src-tauri/target/x86_64-pc-windows-msvc/release/bundle",
|
||||
"src-tauri/target/x86_64-unknown-linux-gnu/release/bundle",
|
||||
"src-tauri/target/aarch64-unknown-linux-gnu/release/bundle",
|
||||
)
|
||||
|
||||
assets = sorted(
|
||||
path
|
||||
for path in version_dir.rglob("*")
|
||||
if path.is_file()
|
||||
and (path.suffix.lower() in ALLOWED_SUFFIXES or path.name in CHECKSUM_NAMES)
|
||||
)
|
||||
|
||||
def collect_assets(root: Path, version: str) -> list[Path]:
|
||||
version_num = version.removeprefix("v")
|
||||
found: list[Path] = []
|
||||
for relative in TAURI_BUNDLE_ROOTS:
|
||||
bundle = root / relative
|
||||
if not bundle.is_dir():
|
||||
continue
|
||||
for path in bundle.rglob("*"):
|
||||
if not path.is_file():
|
||||
continue
|
||||
if path.name.startswith("rw."):
|
||||
continue
|
||||
if path.name in CHECKSUM_NAMES:
|
||||
found.append(path)
|
||||
continue
|
||||
if path.suffix.lower() in ALLOWED_SUFFIXES and version_num in path.name:
|
||||
found.append(path)
|
||||
|
||||
assets = sorted(set(found))
|
||||
installers = [path for path in assets if path.suffix.lower() in ALLOWED_SUFFIXES]
|
||||
checksums = [path for path in assets if path.name in CHECKSUM_NAMES]
|
||||
if not installers:
|
||||
fail(f"{version_dir} 中没有安装包")
|
||||
fail(
|
||||
"未在 src-tauri/target/<triple>/release/bundle/ 找到安装包;"
|
||||
f"请先构建 v{version_num}(不要使用仓库根 release/)"
|
||||
)
|
||||
if not checksums:
|
||||
fail(f"{version_dir} 中没有 SHA256SUMS.txt")
|
||||
fail("bundle 目录中没有 SHA256SUMS.txt(由 ./scripts/build.sh 生成)")
|
||||
|
||||
duplicate_names = {path.name for path in assets if sum(item.name == path.name for item in assets) > 1}
|
||||
if duplicate_names:
|
||||
|
||||
Reference in new issue
Block a user