-
Notifications
You must be signed in to change notification settings - Fork 364
ci: publish plugin marketplace on release #1205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -128,3 +138,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' | ||
| 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This new job downloads artifacts but never checks out the repository and does not pass Useful? React with 👍 / 👎. |
||
| 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 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a changesets publish only includes another workspace package,
packages_publishedis still true, butapps/kimi-code/scripts/native/resolve-release.mjsemitsshould_publish=falseand a fallback@moonshot-ai/kimi-code@<current package.json version>tag. This job will then upload the newly generated marketplace to the previous Kimi Code release (or fail if that tag is absent), so releases for e.g. the SDK/core can mutate the wrong release assets; use the Kimi Code-specifickimi_native_release/should_publishoutput for this job.Useful? React with 👍 / 👎.