Skip to content

ci: merge the desktop release flow into release.yml - #5077

Merged
liruifengv merged 1 commit into
chore/import-2.3-cifrom
chore/import-code-app
Nov 19, 2026
Merged

liruifengv merged 1 commit into
chore/import-2.3-cifrom
chore/import-code-app

Conversation

@liruifengv

@liruifengv liruifengv commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

需求或 Bug

code-app 并入本仓的迁移 PR-2.4(堆叠于 PR-2.3,阶段 2 最后一个):把 desktop 的发版流水线并入本仓 release.yml,release/* 分支一条流水线同时发 CLI 和 desktop;desktop 的 GitHub Release tag 用 [email protected] 前缀(不随包名 kimi-code-app,更可读;首仓首发前定稿)。

Bug 复现步骤

N/A

根本原因

N/A

代码变更

合并后的统一发布流:

release/YYYY-MM-DD 推送
  → version:version-release.mjs(包装 changeset version + 记录 release-plan.json)
      一条 version PR 同时 bump CLI 各包和 kimi-code-app
  → candidate:release-trigger.mjs 等合并提交的 ci.yml 绿
  → publish == true 后并行:
      vscode 发布 / release(npm + CLI native + docs)   # 现状不变
      desktop-release:校验 plan → 建 draft Release(tag = [email protected])
        → desktop-artifacts:workflow_call 调 desktop-build.yml 四平台签名构建
        → publish-desktop-assets:合并 mac 更新元数据 → 上传 → 发布
  release.yml                 # version job 改用 scripts/version-release.mjs(记录 release-plan.json)
+                             # 新增 desktop-release / desktop-artifacts / publish-desktop-assets 三个 job
  scripts/release.mjs         # tag 改为 <package>@<version> 通用形式;
                              # plan 无 desktop 包时优雅退出(build=false),CLI-only 发版自动跳过 desktop 链
  scripts/release.test.mjs    # tag 断言更新 + 新增 desktop-absent 用例(10 例全绿)
  desktop-build.yml           # canary prerelease tag 同步加 kimi-code-app@ 前缀

关键决策:

决策 理由
release.mjs 保留为 desktop 发布段核心 它负责「plan 校验 + draft Release + tag 管理」;kimi-code-app 是 private 包,changesets/action 的 publishedPackages 不含它,版本变化只能靠 release-plan.json 传递
tag 用 kimi-code-desktop@ 而非包名 kimi-code-app@ 在 kimi-code 仓里 kimi-code-app@ 有歧义;与 CLI 的 @moonshot-ai/[email protected] 风格一致;electron-updater 走 CDN generic provider,tag 对存量客户端无影响
CLI-only 发版自动跳过 desktop 链 合并后多数 release 只动 CLI;prepare 输出 build=false 时下游 job 全部跳过

影响范围

  • 对现有 CLI 发布流零行为变化(version 脚本是其超集;desktop job 在 plan 无 desktop 包时整体跳过)。
  • 端到端演练未做(需真实 GitHub 环境):建议合并后先 workflow_dispatch 冒烟 canary 构建,切换窗口再用测试 release 分支走全链路(含 CDN 发布与旧客户端自动更新)。
  • 仓外前置:desktop-signing Environment + Apple/Azure secrets;desktop nightly canary 的外部定时任务需改指本仓(现为对 code-app 跑 gh workflow run desktop-build.yml --ref main -f canary=true)。
  • 验证:release 脚本测试 10 例全绿(含新用例);ratchet / guards / check-comments / oxlint 全绿;全部 workflow YAML 解析通过(顺带修复了 PR-2.3 中去 submodule checkout 时弄坏的一个 fetch-depth checkout 块)。

Checklist

  • 我已阅读并遵循仓库的 AGENTS.md 规范。
  • 我已链接相关 issue。(迁移任务,无 issue)
  • 我已添加证明功能可用的测试。(release.mjs 新增 desktop-absent 用例;其余由既有发布脚本测试覆盖)
  • 已运行 changeset skill,或本 PR 无需 changeset。(无用户可感知变化)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T03:49:04.010281Z 68e7481 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 68e7481

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@68e7481
npx https://pkg.pr.new/@moonshot-ai/kimi-code@68e7481

commit: 68e7481

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4255eae16

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

id: version
with:
version: pnpm run version:release
version: node scripts/version-release.mjs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Drop already-published desktop entries from later plans

When a desktop version has already been published and a later version PR on the same release/* branch changes only CLI packages, this newly activated script retains the previous kimi-code-app entry via previous.packages. The desktop job therefore does not take its intended no-desktop exit; release.mjs check instead verifies the old desktop tag against the new merge SHA and throws Tag ... belongs to another commit, leaving every subsequent CLI-only release workflow on that branch red. Carry forward only packages that are still pending, or remove the desktop entry after its release completes.

AGENTS.md reference: AGENTS.md:L131-L133

Useful? React with 👍 / 👎.

retention-days: 7
upload-artifact-prefix: kimi-code-app
secrets:
APPLE_CERTIFICATE_P12: ${{ secrets.APPLE_CERTIFICATE_P12 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind the reusable build to the signing environment

When the Apple and Azure credentials are stored in the stated desktop-signing environment, these expressions resolve to empty strings because neither the caller nor the reusable workflow's package job selects that environment. GitHub's reusable-workflow documentation explicitly says environment secrets cannot be passed from the caller and must instead be accessed by setting environment on a job in the called workflow. The macOS keychain setup then rejects the empty certificate and Windows signing lacks its credentials, so the new stable desktop release path cannot produce installers with that documented setup.

AGENTS.md reference: AGENTS.md:L131-L133

Useful? React with 👍 / 👎.

longest = Math.max(longest, batch.delaySeconds);
if (bucket < cumulative) {
return Math.min(Math.max(batch.delaySeconds, 0), MAX_ROLLOUT_DELAY_SECONDS);
return Math.max(batch.delaySeconds, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add a desktop changeset for the imported behavior

This commit changes observable desktop behavior—rollout delays can now exceed one day, local-file browser captures become valid, and empty tooltips close—but adds no changeset naming kimi-code-app. Because the newly wired version-release.mjs only places packages whose versions changed into the release plan, these fixes neither bump the desktop version nor trigger a desktop release on their own and will remain unshipped until an unrelated desktop changeset happens to arrive; add the corresponding desktop changeset and release-note sentence.

AGENTS.md reference: AGENTS.md:L94-L95

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5967317d81

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/ci.yml
- name: Typecheck
run: |
pnpm exec tsc --version
for config in packages/*/tsconfig.json apps/kimi-code/tsconfig.json; do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the desktop typecheck job

When a change introduces a semantic TypeScript or Vue error under apps/desktop, this loop now checks only packages/* and apps/kimi-code, while the dedicated pnpm --filter kimi-code-app run typecheck step was removed. Typechecking the source-only app-* packages does not cover the desktop main process, renderer, or renderer tests, and the build job's Vite/tsdown transpilation is not a replacement for the removed tsc and vue-tsc checks, so such errors can reach the release workflow without CI detecting them.

Useful? React with 👍 / 👎.

@liruifengv
liruifengv force-pushed the chore/import-code-app branch from 4d82969 to 73ecc5c Compare November 19, 2026 03:26
@liruifengv
liruifengv force-pushed the chore/import-code-app branch 2 times, most recently from 551e8a4 to 4e13225 Compare November 19, 2026 03:27
@liruifengv
liruifengv force-pushed the chore/import-code-app branch from 4e13225 to a1cba6c Compare November 19, 2026 03:30
One pipeline on release/* branches now ships both CLI and desktop: the
version job runs scripts/version-release.mjs (records
release-plan.json) so one version PR bumps CLI and kimi-code-app
together; new desktop-release / desktop-artifacts /
publish-desktop-assets jobs validate the plan, build four signed
platform artifacts via desktop-build.yml, and publish a GitHub Release
tagged kimi-code-desktop@<version>. CLI-only releases skip the desktop
chain (release.mjs exits with build=false when the plan has no desktop
package). The canary prerelease tag uses the same kimi-code-desktop@
prefix.
@liruifengv
liruifengv force-pushed the chore/import-code-app branch from a1cba6c to 68e7481 Compare November 19, 2026 03:47
@liruifengv
liruifengv merged commit 1dbdd02 into chore/import-2.3-ci Nov 19, 2026
15 checks passed
@liruifengv
liruifengv deleted the chore/import-code-app branch November 19, 2026 03:51
liruifengv added a commit that referenced this pull request Nov 19, 2026
* ci: bring the desktop build workflows into the monorepo

desktop-build.yml imported from code-app with the submodule checkout
removed; triggers unchanged (release-branch pushes, dispatch,
workflow_call). New desktop-ci.yml runs the Windows screenshot-native
build, real window enumeration, and desktop tests on windows-latest,
gated to desktop-related paths on PRs and full-suite on dispatch. The
ci.yml release-workflow-tests job now also runs the imported
release.test.mjs.

desktop-e2e.yml is held back until the fullmoon-* self-hosted runners
are granted to this repository.

The main-window host-view tests now stub process.resourcesPath like the
other describes in the file: on win32 runners windowsWindowOptions
actually joins it, which failed with 'path argument must be of type
string' the first time these tests ran on Windows.

* ci: merge the desktop release flow into release.yml (#5077)

One pipeline on release/* branches now ships both CLI and desktop: the
version job runs scripts/version-release.mjs (records
release-plan.json) so one version PR bumps CLI and kimi-code-app
together; new desktop-release / desktop-artifacts /
publish-desktop-assets jobs validate the plan, build four signed
platform artifacts via desktop-build.yml, and publish a GitHub Release
tagged kimi-code-desktop@<version>. CLI-only releases skip the desktop
chain (release.mjs exits with build=false when the plan has no desktop
package). The canary prerelease tag uses the same kimi-code-desktop@
prefix.
liruifengv added a commit that referenced this pull request Nov 19, 2026
)

* build: produce the CLI's bundled web UI from the desktop renderer

dist-web is no longer committed: apps/kimi-code's prebuild runs
scripts/sync-web-dist.mjs, which builds the desktop renderer's web
variant and copies it into apps/kimi-code/dist-web; the native-assets
workflow and the nix build do the same before packaging. The root
gains a sync:web alias and check-web-assets.mjs stays as the packaging
guard with an updated message; the stale .commentignore exemption for
the previously committed bundle is dropped.

* ci: bring the desktop build workflows into the monorepo (#5076)

* ci: bring the desktop build workflows into the monorepo

desktop-build.yml imported from code-app with the submodule checkout
removed; triggers unchanged (release-branch pushes, dispatch,
workflow_call). New desktop-ci.yml runs the Windows screenshot-native
build, real window enumeration, and desktop tests on windows-latest,
gated to desktop-related paths on PRs and full-suite on dispatch. The
ci.yml release-workflow-tests job now also runs the imported
release.test.mjs.

desktop-e2e.yml is held back until the fullmoon-* self-hosted runners
are granted to this repository.

The main-window host-view tests now stub process.resourcesPath like the
other describes in the file: on win32 runners windowsWindowOptions
actually joins it, which failed with 'path argument must be of type
string' the first time these tests ran on Windows.

* ci: merge the desktop release flow into release.yml (#5077)

One pipeline on release/* branches now ships both CLI and desktop: the
version job runs scripts/version-release.mjs (records
release-plan.json) so one version PR bumps CLI and kimi-code-app
together; new desktop-release / desktop-artifacts /
publish-desktop-assets jobs validate the plan, build four signed
platform artifacts via desktop-build.yml, and publish a GitHub Release
tagged kimi-code-desktop@<version>. CLI-only releases skip the desktop
chain (release.mjs exits with build=false when the plan has no desktop
package). The canary prerelease tag uses the same kimi-code-desktop@
prefix.
liruifengv added a commit that referenced this pull request Nov 19, 2026
* chore: import code-app sources into the monorepo

Snapshot-import the Kimi Code desktop app and its client packages from
code-app (source: MoonshotAI/kimi-code-app desktop-opensource), without
git history: apps/desktop, packages/app-*, vite-preset, patches,
icon-tools, desktop release scripts, brand sources, release-notes. The
snapshot includes code-app's latest product commits (#1364 rollout cap
removal, #1365 local file annotations, #1367 empty tooltip fix).

Not carried: apps/rc-portal, READMEs, apps/desktop/docs, the
changeset/release-notes skills, code-app's pending changesets (they
return at cutover), and .changeset/release-plan.json (its referenced
changesets stay behind; the release flow regenerates it).

Host-repo adaptations: workspace overrides (ssh2, zod, shiki 4.3.1,
linkedom 0.18.12, canvas excluded), markstream-vue patch, root scripts
and typecheck aggregation, vitest projects, flake.nix workspace lists,
oxlint grandfathering of legacy findings via the ratchet baseline,
check-comments strip of 401 legacy comments, a CI typecheck step for
the desktop app, and pre-public audit scrubs (internal wiki revision in
release_branch_kind.py, GitLab-CI wording in the local signing
scripts).

* build: produce the CLI's bundled web UI from the desktop renderer (#5075)

* build: produce the CLI's bundled web UI from the desktop renderer

dist-web is no longer committed: apps/kimi-code's prebuild runs
scripts/sync-web-dist.mjs, which builds the desktop renderer's web
variant and copies it into apps/kimi-code/dist-web; the native-assets
workflow and the nix build do the same before packaging. The root
gains a sync:web alias and check-web-assets.mjs stays as the packaging
guard with an updated message; the stale .commentignore exemption for
the previously committed bundle is dropped.

* ci: bring the desktop build workflows into the monorepo (#5076)

* ci: bring the desktop build workflows into the monorepo

desktop-build.yml imported from code-app with the submodule checkout
removed; triggers unchanged (release-branch pushes, dispatch,
workflow_call). New desktop-ci.yml runs the Windows screenshot-native
build, real window enumeration, and desktop tests on windows-latest,
gated to desktop-related paths on PRs and full-suite on dispatch. The
ci.yml release-workflow-tests job now also runs the imported
release.test.mjs.

desktop-e2e.yml is held back until the fullmoon-* self-hosted runners
are granted to this repository.

The main-window host-view tests now stub process.resourcesPath like the
other describes in the file: on win32 runners windowsWindowOptions
actually joins it, which failed with 'path argument must be of type
string' the first time these tests ran on Windows.

* ci: merge the desktop release flow into release.yml (#5077)

One pipeline on release/* branches now ships both CLI and desktop: the
version job runs scripts/version-release.mjs (records
release-plan.json) so one version PR bumps CLI and kimi-code-app
together; new desktop-release / desktop-artifacts /
publish-desktop-assets jobs validate the plan, build four signed
platform artifacts via desktop-build.yml, and publish a GitHub Release
tagged kimi-code-desktop@<version>. CLI-only releases skip the desktop
chain (release.mjs exits with build=false when the plan has no desktop
package). The canary prerelease tag uses the same kimi-code-desktop@
prefix.
liruifengv added a commit that referenced this pull request Nov 19, 2026
* chore: import code-app sources into the monorepo (#5074)

* chore: import code-app sources into the monorepo

Snapshot-import the Kimi Code desktop app and its client packages from
code-app (source: MoonshotAI/kimi-code-app desktop-opensource), without
git history: apps/desktop, packages/app-*, vite-preset, patches,
icon-tools, desktop release scripts, brand sources, release-notes. The
snapshot includes code-app's latest product commits (#1364 rollout cap
removal, #1365 local file annotations, #1367 empty tooltip fix).

Not carried: apps/rc-portal, READMEs, apps/desktop/docs, the
changeset/release-notes skills, code-app's pending changesets (they
return at cutover), and .changeset/release-plan.json (its referenced
changesets stay behind; the release flow regenerates it).

Host-repo adaptations: workspace overrides (ssh2, zod, shiki 4.3.1,
linkedom 0.18.12, canvas excluded), markstream-vue patch, root scripts
and typecheck aggregation, vitest projects, flake.nix workspace lists,
oxlint grandfathering of legacy findings via the ratchet baseline,
check-comments strip of 401 legacy comments, a CI typecheck step for
the desktop app, and pre-public audit scrubs (internal wiki revision in
release_branch_kind.py, GitLab-CI wording in the local signing
scripts).

* build: produce the CLI's bundled web UI from the desktop renderer (#5075)

* build: produce the CLI's bundled web UI from the desktop renderer

dist-web is no longer committed: apps/kimi-code's prebuild runs
scripts/sync-web-dist.mjs, which builds the desktop renderer's web
variant and copies it into apps/kimi-code/dist-web; the native-assets
workflow and the nix build do the same before packaging. The root
gains a sync:web alias and check-web-assets.mjs stays as the packaging
guard with an updated message; the stale .commentignore exemption for
the previously committed bundle is dropped.

* ci: bring the desktop build workflows into the monorepo (#5076)

* ci: bring the desktop build workflows into the monorepo

desktop-build.yml imported from code-app with the submodule checkout
removed; triggers unchanged (release-branch pushes, dispatch,
workflow_call). New desktop-ci.yml runs the Windows screenshot-native
build, real window enumeration, and desktop tests on windows-latest,
gated to desktop-related paths on PRs and full-suite on dispatch. The
ci.yml release-workflow-tests job now also runs the imported
release.test.mjs.

desktop-e2e.yml is held back until the fullmoon-* self-hosted runners
are granted to this repository.

The main-window host-view tests now stub process.resourcesPath like the
other describes in the file: on win32 runners windowsWindowOptions
actually joins it, which failed with 'path argument must be of type
string' the first time these tests ran on Windows.

* ci: merge the desktop release flow into release.yml (#5077)

One pipeline on release/* branches now ships both CLI and desktop: the
version job runs scripts/version-release.mjs (records
release-plan.json) so one version PR bumps CLI and kimi-code-app
together; new desktop-release / desktop-artifacts /
publish-desktop-assets jobs validate the plan, build four signed
platform artifacts via desktop-build.yml, and publish a GitHub Release
tagged kimi-code-desktop@<version>. CLI-only releases skip the desktop
chain (release.mjs exits with build=false when the plan has no desktop
package). The canary prerelease tag uses the same kimi-code-desktop@
prefix.

* build(nix): include patches/ in the nix src fileset

pnpm-workspace.yaml now carries a patchedDependency
([email protected]) whose patch file lives under patches/; the nix
build's src fileset did not include it, so fetchPnpmDeps failed with
ENOENT before even reaching the hash check.

* build(nix): update fetchPnpmDeps hash for the merged lockfile

Reported by the nix-build CI on #5079 after patches/ entered the src
fileset.

* build(nix): include tsconfig.base.json in the nix src fileset

The desktop renderer's tsconfig extends ../../tsconfig.base.json, and
vite resolves it while building the web variant inside the nix sandbox
(via sync-web-dist). The file came from the code-app import and was not
in the fileset.

* chore: bring over code-app's pending changesets and rewrite the release skills (#5081)

31 unconsumed changesets from code-app's desktop-opensource (26 at the
snapshot point plus 5 added by later main merges), covering every
user-facing desktop change since v1.3.7. Entries are translated to
English per this repo's changeset conventions, with overlong ones
condensed. code-app's release-plan.json is intentionally not carried:
every consumer reads it gated on the branch name, so the stale plan
would be inert on any new release branch.

gen-changesets is rewritten for the three-product world: the CLI,
desktop, and the VS Code extension are user-facing products whose
changesets feed release notes, update dialogs, and marketplaces;
library source changes always get a library changeset, and changes
that flow into a product user-perceivably get a product entry too.
sync-changelog now covers two flows: Flow A syncs the CLI changelog
into the docs site (unchanged rules), and Flow B prepares the
desktop update-dialog bilingual notes under release-notes/<version>
from apps/desktop/CHANGELOG.md — curated from English entries and
translated into Chinese, with hard length limits (15 words / 40
characters / 10 entries) and a review-before-commit gate.
pre-changelog previews both Chinese surfaces before a release PR
merges, and locates the version PR by its release/* base branch.

* chore: rename dev:desktop:canary to dev:desktop-canary

* fix: run the web-variant build through a shell on Windows

Node cannot execute pnpm.cmd directly via spawnSync on Windows; the
sync script now goes through the shell there, unblocking pnpm build on
Windows machines and the Windows legs of the native-assets workflow.

Also bring the root guide's web UI entry up to date with the imported
reality: the source is the desktop renderer, dist-web is a build-time
artifact, and pnpm dev:web / sync:web are the in-repo commands.

(--no-verify: lint-staged's oxlint step fails with 'No files found to
lint' for paths under its ignorePatterns, such as apps/*/scripts/;
check-comments and node --check pass.)

* docs: dedupe the gen-changesets rules after the main merge

The conflict resolution re-inserted the product/library bullets that
were shared context after the conflict block.

* docs: rewrite the gen-changesets section 1 bullet list cleanly

The previous dedupe commit made the duplication worse; the section is
now rewritten as a whole: product, library, public KAP, flows-into-
product, ignored packages, ask-when-unsure.
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