Skip to content

[break] feat(builder): add publish build stage mirroring upload flow … - #901

Merged
star-e merged 4 commits into
cocos:mainfrom
tangkaikk:feat/publish-stage
Sep 1, 2026
Merged

[break] feat(builder): add publish build stage mirroring upload flow …#901
star-e merged 4 commits into
cocos:mainfrom
tangkaikk:feat/publish-stage

Conversation

@tangkaikk

Copy link
Copy Markdown
Contributor

…(#publish)

Add a new publish build stage as a chained post-build step, mirroring the existing upload stage's flow but with a placeholder implementation.

  • schema: extend nextStages enum with publish; add SchemaPublishResult / IPublishResultData
  • api: BuilderApi.publish -> executeBuildStageTask(platform, 'publish', ...)
  • api: CocosAPI.publishProject entry point
  • launcher: Launcher.publish static method
  • cli: register PublishCommand (cocos publish -p <platform> -d <dest>)
  • types: declare publish hook in IInternalHook / BuildHook namespaces (only the main publish hook, no before/after wrappers)
  • platform config (web-mobile/web-desktop): register publish in customBuildStages with distinct publishStage.* i18n keys to avoid collision with the upload stage's existing publish.* keys
  • platform hooks (web-mobile/web-desktop): add publish delegating to webPublish.publish
  • web-common/publish.ts: placeholder implementation that reads the packageId produced by a prior successful upload stage and writes custom.publish = { pending, success, packageId }; the real publish/release API call is left as a TODO
  • tests: mirror builder-api-upload.spec.ts -> builder-api-publish.spec.ts

tangkaikk and others added 4 commits September 1, 2026 17:40
…(#publish)

Add a new `publish` build stage as a chained post-build step, mirroring the
existing `upload` stage's flow but with a placeholder implementation.

- schema: extend `nextStages` enum with `publish`; add `SchemaPublishResult` /
  `IPublishResultData`
- api: `BuilderApi.publish` -> `executeBuildStageTask(platform, 'publish', ...)`
- api: `CocosAPI.publishProject` entry point
- launcher: `Launcher.publish` static method
- cli: register `PublishCommand` (`cocos publish -p <platform> -d <dest>`)
- types: declare `publish` hook in `IInternalHook` / `BuildHook` namespaces
  (only the main `publish` hook, no before/after wrappers)
- platform config (web-mobile/web-desktop): register `publish` in
  `customBuildStages` with distinct `publishStage.*` i18n keys to avoid
  collision with the upload stage's existing `publish.*` keys
- platform hooks (web-mobile/web-desktop): add `publish` delegating to
  `webPublish.publish`
- web-common/publish.ts: placeholder implementation that reads the
  `packageId` produced by a prior successful upload stage and writes
  `custom.publish = { pending, success, packageId }`; the real publish/release
  API call is left as a TODO
- tests: mirror `builder-api-upload.spec.ts` -> `builder-api-publish.spec.ts`

Co-Authored-By: Claude Code <noreply@anthropic.com>
@tangkaikk
tangkaikk requested a review from star-e September 1, 2026 13:35
@star-e
star-e merged commit 11c2a9e into cocos:main Sep 1, 2026
4 checks passed
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.

2 participants