Skip to content

ci: bring the desktop build workflows into the monorepo - #5076

Merged
liruifengv merged 2 commits into
chore/import-2.2-dist-webfrom
chore/import-2.3-ci
Nov 19, 2026
Merged

liruifengv merged 2 commits into
chore/import-2.2-dist-webfrom
chore/import-2.3-ci

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

需求或 Bug

code-app 并入本仓的迁移 PR-2.3(堆叠于 PR-2.2):把 desktop 的构建与检查 CI 迁入本仓,并按路径 scope 控制触发面——普通 CLI PR 不背 desktop 的重型任务。

Bug 复现步骤

N/A

根本原因

N/A

代码变更

+ .github/workflows/desktop-build.yml   # desktop 四平台构建/签名/公证流水线
                                        # 触发器原样:release/** push、workflow_dispatch、workflow_call
                                        # (去掉了 3 处 submodule checkout)
+ .github/workflows/desktop-ci.yml      # 新增:Windows 截图原生编译 + 真实窗口枚举 + desktop 测试
                                        # PR 按 desktop 路径触发(apps/desktop、packages/app-*、patches)
                                        # 手动 dispatch 跑 Windows 全量
  .github/workflows/ci.yml               # release-workflow-tests job 补跑导入的 release.test.mjs
- .github/workflows/desktop-e2e.yml     # 曾一并迁入,本 PR 内又撤出(见下)

关键决策:

决策 理由
desktop-e2e.yml 暂缓迁入 它依赖 fullmoon-* 自托管 runner,本仓未获授权前迁入只会排队;待 runner 授权后带回
全仓 lint / typecheck / test 保持全量跑 导入后它们已覆盖 desktop 包(CLI PR 约多 1–2 分钟);细粒度按依赖图跳过等真实 CI 时长数据后再做
Windows 检查独立成 desktop-ci.yml 与 code-app 行为对齐(PR 跑截图相关用例、dispatch 跑全量),路径过滤天然隔离 CLI PR

影响范围

  • CLI PR:仅 ci.yml 多跑 2 个发布脚本测试文件(秒级)。
  • desktop 相关 PR:新增 Windows 检查(截图原生编译 + 窗口枚举 + 截图用例)。
  • desktop-build.yml 依赖 desktop-signing Environment 的签名 secrets(仓外配置,release 流程启用前必须就位)。
  • 验证:全部 workflow 文件 YAML 解析通过;发布脚本测试本地 0 失败。

Checklist

  • 我已阅读并遵循仓库的 AGENTS.md 规范。
  • 我已链接相关 issue。(迁移任务,无 issue)
  • 我已添加证明功能可用的测试。(CI 变更由 workflow 本身与脚本测试覆盖)
  • 已运行 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:55:02.206222Z 1dbdd02 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: 1dbdd02

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@cd3c96e
npx https://pkg.pr.new/@moonshot-ai/kimi-code@cd3c96e

commit: cd3c96e

@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: d0923dd20f

ℹ️ 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 on lines +176 to +177
- uses: actions/checkout@v6
fetch-depth: 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.

P1 Badge Restore valid YAML for the checkout inputs

The fetch-depth entry is over-indented and has no enclosing with: mapping, so this file fails YAML parsing at line 177 (mapping values are not allowed in this context). Consequently GitHub cannot load the newly added workflow, leaving release-branch pushes, manual desktop builds, and reusable-workflow calls unable to build any installers.

Useful? React with 👍 / 👎.

package:
name: Build installers (${{ matrix.target }})
needs: matrix-source
runs-on: ${{ matrix.os }}

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 installer builds to the signing environment

When the signing credentials are configured in the desktop-signing Environment as required by this change's deployment notes, this job never selects that environment, so every secrets.APPLE_* and secrets.AZURE_* lookup resolves empty; GitHub only exposes environment secrets to jobs that reference the environment. After the YAML error is fixed, the macOS keychain setup and Windows signing legs therefore fail instead of producing signed installers. Add the environment binding to this job (and preserve any intended protection rules). GitHub's environment documentation confirms this access requirement.

Useful? React with 👍 / 👎.

@liruifengv
liruifengv force-pushed the chore/import-2.2-dist-web branch from 9f377a7 to 12a03b0 Compare November 19, 2026 03:20
@liruifengv
liruifengv force-pushed the chore/import-2.3-ci branch 2 times, most recently from 7ce9bb3 to 437b4a1 Compare November 19, 2026 03:26
@liruifengv
liruifengv force-pushed the chore/import-2.2-dist-web branch from 12a03b0 to 54fcbd6 Compare November 19, 2026 03:26
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.
@liruifengv
liruifengv force-pushed the chore/import-2.2-dist-web branch from 54fcbd6 to fd2d7eb Compare November 19, 2026 03:30

@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: cd3c96ee18

ℹ️ 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 on lines +49 to +50
# release.yml 通过 workflow_call 调用本 workflow 打发版产物。
workflow_call:

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 Wire the desktop builder into the release workflow

This exposes a reusable workflow and explicitly says release.yml calls it, but a repo-wide search and inspection of .github/workflows/release.yml show no uses: ./.github/workflows/desktop-build.yml caller. Consequently, when a release version commit passes the existing candidate gate, the release workflow can publish the other products but never starts a stable desktop build; stable desktop installers remain available only through a manual dispatch.

Useful? React with 👍 / 👎.

Comment on lines +364 to +368
uses: actions/upload-artifact@v7
with:
path: apps/desktop/dist-app/*.dmg
archive: false
retention-days: ${{ inputs.retention-days || 7 }}

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 Give each direct installer upload a unique artifact name

These direct uploads omit name, whose documented default is artifact; the stable matrix runs this DMG step in both macOS legs, while Preview runs it alongside the similarly unnamed Windows EXE upload. The upload-artifact action documents that concurrent jobs cannot upload to the same named artifact, so one leg fails and does not reach its subsequent release-bundle upload. Assign a matrix/channel-specific name to both direct uploads; see the action's name input and its same-name restriction.

Useful? React with 👍 / 👎.

Comment on lines +20 to +23
on:
push:
branches: ['release/**']
workflow_dispatch:

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 the missing scheduled Canary trigger

The trigger list contains only release-branch pushes and manual dispatches, so github.event_name == 'schedule' can never be true. This leaves nightly-guard and every scheduled-Canary condition later in the workflow unreachable, meaning nightly Canary users receive no scheduled build or prerelease despite the workflow implementing that path.

Useful? React with 👍 / 👎.

Comment on lines +192 to +193
pnpm install --frozen-lockfile --ignore-scripts
node scripts/canary-version.mjs >> "$GITHUB_OUTPUT"

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 Align Canary version resolution with the repository release plan

On a normal release/* push this invokes canary-version.mjs, which exits unless it finds either a pending kimi-code-app changeset or a matching .changeset/release-plan.json entry. The repository's version jobs still run plain changeset version, .changeset/README.md excludes the private desktop package from the publishable changeset list, and the repo-wide search shows that the custom scripts/version-release.mjs which writes that plan is never invoked; therefore ordinary weekly release branches fail in “Resolve Canary version” before any installers are built. Wire the custom version flow into the release PR or make this resolver derive a desktop version from the actual release state.

AGENTS.md reference: AGENTS.md:L79-L80

Useful? React with 👍 / 👎.

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 merged commit 0d256bf into chore/import-2.2-dist-web Nov 19, 2026
14 checks passed
@liruifengv
liruifengv deleted the chore/import-2.3-ci branch November 19, 2026 03:51
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