chore(release): build extension zip locally during npm run release - #8
Merged
Conversation
Previously `npm run release` only bumped the version and pushed the tag, leaving the actual zip to be built by CI — so there was no local artifact. Now the release script runs `npm run build:ext` before committing/tagging, and a failed build rolls back the version bump and aborts before anything is published. The zip is written to frontend/release/ (gitignored) instead of the frontend root, matching where release artifacts are kept; the CI artifact path is updated to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
让
npm run release在打 tag 之前顺手在本地构建好扩展 zip,发版后本地frontend/release/文件夹直接出现当版 zip,无需再去 CI 下载。Changes
frontend/scripts/release.mjs— 版本号 bump 后、提交/打 tag 之前插入npm run build:ext。构建失败会回滚版本号改动并中止,坏构建永远不会被打 tag 推出去(比之前"推上去才在 CI 发现失败"更安全)frontend/scripts/zip.mjs— 产物输出目录从 frontend 根目录改为frontend/release/(已在 .gitignore 中,目录不存在时自动创建),与用户存放发布产物的位置一致.github/workflows/build.yml— CI artifact 路径同步更新为frontend/release/catheadtab-*.zipWhy
此前
npm run release只做版本 bump + 打 tag + 推送,真正的 zip 完全由 CI 构建,本地没有产物。现在本地与 CI 产出同一个 zip,发版流程:一条npm run release= 本地release/出 zip + CI 出 GitHub Release。Test plan
npm run build:ext,确认 zip 生成在frontend/release/catheadtab-v<version>.zipnpm run release,确认本地 release 文件夹出现当版 zip 且 CI Release 产物一致Notes
改的是 release 脚本本身,合并后从 下次发版 v1.0.4 起生效(v1.0.3 已发布)。