Skip to content

chore(release): build extension zip locally during npm run release - #8

Merged
DeaglePC merged 1 commit into
mainfrom
chore/local-release-build
Jun 11, 2026
Merged

chore(release): build extension zip locally during npm run release#8
DeaglePC merged 1 commit into
mainfrom
chore/local-release-build

Conversation

@DeaglePC

Copy link
Copy Markdown
Owner

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-*.zip

Why

此前 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>.zip
  • 下次发版(v1.0.4)跑 npm run release,确认本地 release 文件夹出现当版 zip 且 CI Release 产物一致
  • 构造一次构建失败,确认版本号 bump 被回滚、未产生提交和 tag

Notes

改的是 release 脚本本身,合并后从 下次发版 v1.0.4 起生效(v1.0.3 已发布)。

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>
@DeaglePC
DeaglePC merged commit e6e3264 into main Jun 11, 2026
2 checks passed
@DeaglePC
DeaglePC deleted the chore/local-release-build branch June 11, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant