fix(ci): 修复 Linux .deb 包 Package 字段非法导致无法安装#32
Open
AiW520 wants to merge 1 commit into
Open
Conversation
…ckage name deb 打包时 productName 会被转成 kebab-case 作为 DEBIAN/control 的 Package 字段,而当前 productName 为中文 '兔子switch',导致 sudo dpkg -i 报 '必须以字母或数字开头'。Windows 构建早已通过 --config 覆盖 productName, Linux 段遗漏,本次补齐。 同时新增 docs/bugfix-linux-deb-package-name.md 记录根因与修复。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
用户反馈从 GitHub Releases 下载
tuzi-switch-linux-x86_64.deb后,用sudo dpkg -i安装失败:根因
Tauri 打包 deb 时会把
productName转成 kebab-case 写入DEBIAN/control的Package:字段。项目productName是 “兔子switch”(中文开头),不符合 Debian 命名规则(Package:必须以字母/数字开头)。同一个 workflow 中 Windows 构建早已通过
--config '{"productName":"tuzi switch"}'覆盖过(因为 MSI/NSIS 也有类似限制),但 Linux 构建段落遗漏了这一步,直接使用了默认的中文productName,产出了非法的 deb 控制文件。修复
在
.github/workflows/build.yml的build-linux作业里,把两处pnpm tauri build都加上--config '{"productName":"tuzi switch"}':--config '{"productName":"tuzi switch","bundle":{"createUpdaterArtifacts":false}}'--config '{"productName":"tuzi switch"}'修复后 deb 控制文件里应为
Package: tuzi-switch(合法:字母开头、仅含小写字母数字与连字符)。macOS / AppImage 无此限制,无需改动。影响面
.deb(以及类似规则的.rpm)构建产物.dmg、Windows.msi/.exe、Linux.AppImage均不受影响tauri.conf.json中的productName未改动,只在 Linux 构建阶段临时覆盖)验证步骤
新版本发布后:
tuzi-switch-linux-x86_64.debdpkg-deb -f tuzi-switch-linux-x86_64.deb Package应输出tuzi-switchsudo dpkg -i tuzi-switch-linux-x86_64.deb能正常完成安装变更文件
.github/workflows/build.yml:Linux 构建段落pnpm tauri build加 productName 覆盖docs/bugfix-linux-deb-package-name.md:新增修复文档,记录现象、根因、方案、验证方式与用户临时规避方案用户临时规避方案(在下一版发布前)
.AppImage或一键安装脚本dpkg-deb -R拆包,手改DEBIAN/control的Package:后dpkg-deb -b重打