build(packaging): 产物改名成 名字_版本号_平台_架构

用户令:产物名不带实现细节字样(不出现 iced),格式统一成
`<名字>_<版本号>_<平台>_<架构>`,下划线分段。

- make_artifacts.py 新增 asset_stem() 作为唯一真相源;Windows 裸 exe 那条
  路径原来还硬写着旧格式,一并改掉
- release.yml 的 sha256sum 与 assets glob 从 unlucky-launcher-* 改
  unlucky-launcher_*(不改会因匹配不到而漏传产物)
- packaging/README.md 矩阵六行同步,并记下:Linux/macOS 仍为 tar.gz,
  理由是许可文本随包 + tar 保留 755 可执行位

本地已跑通:unlucky-launcher_0.1.0_windows_x64.exe 14.44 MiB +
ull_0.1.0_windows_x64.exe 6.18 MiB + SHA256SUMS.txt。
This commit is contained in:
AskaEth committed 2026-11-05 11:54:18 +08:00
1 parent 43ab6c0a83
commit 6a5c54102e
3 files changed
+41 -26

No files matched your search

+26 -11
View File
@@ -3,15 +3,19 @@
Release matrix (see `packaging/README.md` for the full contract):
Windows x64 unlucky-launcher-<ver>-windows-x64.exe (bare exe, no zip)
Windows arm64 unlucky-launcher-<ver>-windows-arm64.exe (bare exe, cross-built)
Linux x64 unlucky-launcher-<ver>-linux-x64.tar.gz
Linux arm64 unlucky-launcher-<ver>-linux-arm64.tar.gz
macOS arm64 unlucky-launcher-<ver>-macos-arm64.tar.gz
macOS x64 unlucky-launcher-<ver>-macos-x64.tar.gz
every slot ull-<ver>-<slot>[.exe] (bare CLI binary, no archive)
Windows x64 unlucky-launcher_<ver>_windows_x64.exe (bare exe, no zip)
Windows arm64 unlucky-launcher_<ver>_windows_arm64.exe (bare exe, cross-built)
Linux x64 unlucky-launcher_<ver>_linux_x64.tar.gz
Linux arm64 unlucky-launcher_<ver>_linux_arm64.tar.gz
macOS arm64 unlucky-launcher_<ver>_macos_arm64.tar.gz
macOS x64 unlucky-launcher_<ver>_macos_x64.tar.gz
every slot ull_<ver>_<platform>_<arch>[.exe] (bare CLI binary, no archive)
all SHA256SUMS.txt
Naming rule (user's call, 2026-11-05): `<name>_<version>_<platform>_<arch>`, underscore
separated, and **no implementation detail in the file name** — the asset never says which UI
framework produced it. `asset_stem()` is the single source of truth for that.
`--version` is taken from the cargo workspace so a tag can never drift away from
`Cargo.toml`; pass `--version` to cross-check a tag against it (mismatch is fatal).
The archives carry the launcher binary plus LICENSE / NOTICE / README.md, which is
@@ -205,9 +209,20 @@ def write_sums(out_dir: Path, assets: list[Path]) -> Path:
return sums
def asset_stem(name: str, version: str, slot: str) -> str:
"""`<name>_<version>_<platform>_<arch>` — 产物命名的唯一真相源。
用户令(2026-11-05):产物名按 `名字_版本号_平台_架构` 下划线分段,且**不得出现 `iced`
这类实现细节字样** —— 下载的人不该关心我们内部用哪个 UI 框架。槽位键(`windows-x64`)
仍是脚本内部的写法,落到文件名时拆成 `windows_x64` 两段。
"""
family, arch, _kind = SLOTS[slot]
return f"{name}_{version}_{family}_{arch}"
def stage_cli(out_dir: Path, version: str, slot: str, cli: Path) -> Path:
"""Copy the CLI out as its own bare asset (`ull-<ver>-<slot>[.exe]`)."""
name = f"{CLI_BIN}-{version}-{slot}" + (".exe" if cli.suffix == ".exe" else "")
"""Copy the CLI out as its own bare asset (`ull_<ver>_<platform>_<arch>[.exe]`)."""
name = asset_stem(CLI_BIN, version, slot) + (".exe" if cli.suffix == ".exe" else "")
asset = out_dir / name
shutil.copy2(cli, asset)
# 裸文件下载即可运行:Windows 宿主机上源文件没有 x 位,这里补上(UNIX 侧才有意义)。
@@ -217,7 +232,7 @@ def stage_cli(out_dir: Path, version: str, slot: str, cli: Path) -> Path:
def stage_archive(out_dir: Path, tag: str, version: str, launcher: Path) -> Path:
"""tar.gz with one top-level dir holding the binary + compliance docs."""
stem = f"unlucky-launcher-{version}-{tag}"
stem = asset_stem(LAUNCHER_ASSET, version, tag)
stage = out_dir / stem
if stage.exists():
shutil.rmtree(stage)
@@ -281,7 +296,7 @@ def main() -> int:
out_dir.mkdir(parents=True, exist_ok=True)
if kind == "exe":
asset = out_dir / f"unlucky-launcher-{version}-{slot}.exe"
asset = out_dir / f"{asset_stem(LAUNCHER_ASSET, version, slot)}.exe"
shutil.copy2(launcher, asset)
else:
asset = stage_archive(out_dir, slot, version, launcher)