Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/plugin-marketplace-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@moonshot-ai/kimi-code": patch
---

feat(ci): publish plugin marketplace on release

- Add `build:plugin-marketplace` step to the release workflow
- Upload plugin marketplace artifacts as GitHub Release assets
- Make `build-plugin-marketplace-cdn` script skip missing sources gracefully
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ jobs:
- name: Build packages
run: pnpm build

- name: Build plugin marketplace
run: pnpm run build:plugin-marketplace

- name: Upload plugin marketplace artifact
uses: actions/upload-artifact@v4
with:
name: plugin-marketplace
path: plugins/cdn
retention-days: 7

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
Expand Down Expand Up @@ -144,3 +154,33 @@ jobs:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.release.outputs.kimi_release_tag }}
run: gh release upload "$RELEASE_TAG" dist-native-release/* --clobber

publish-plugin-marketplace:
name: Publish plugin marketplace
needs: release
if: needs.release.outputs.packages_published == 'true'

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 Gate marketplace upload on the Kimi package release

When Changesets publishes any package other than @moonshot-ai/kimi-code, packages_published is still true, but apps/kimi-code/scripts/native/resolve-release.mjs emits should_publish=false and a fallback tag based on the current Kimi package version. This new job would then upload the freshly built marketplace to a stale or nonexistent Kimi Code release tag (with --clobber, potentially overwriting the previous release asset) instead of skipping like publish-native-assets does; gate this on needs.release.outputs.kimi_native_release == 'true' or an equivalent Kimi-package-published output.

Useful? React with 👍 / 👎.

runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Download plugin marketplace artifact
uses: actions/download-artifact@v8
with:
name: plugin-marketplace
path: dist-plugin-marketplace
merge-multiple: true

- name: Upload plugin marketplace to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.release.outputs.kimi_release_tag }}
run: |
# The artifact contains files directly under dist-plugin-marketplace/
cd dist-plugin-marketplace
gh release upload "$RELEASE_TAG" marketplace.json --clobber
find . -name "*.zip" -exec gh release upload "$RELEASE_TAG" {} --clobber \;
cd ..
# Also upload as a zip archive for convenience
zip -r plugin-marketplace.zip dist-plugin-marketplace
gh release upload "$RELEASE_TAG" plugin-marketplace.zip --clobber
3 changes: 2 additions & 1 deletion apps/kimi-code/scripts/build-plugin-marketplace-cdn.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ async function materializeEntrySource(source, pluginsRoot, outDir) {
const sourcePath = resolveInsideRoot(pluginsRoot, source);
const info = await stat(sourcePath).catch(() => undefined);
if (info === undefined) {
throw new Error(`Marketplace source does not exist: ${source}`);
console.warn(`Warning: Marketplace source does not exist, skipping: ${source}`);
return { source };
}

if (info.isDirectory()) {
Expand Down
Loading