-
Notifications
You must be signed in to change notification settings - Fork 693
Update main for new workflow #615
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
Conversation
* feat: Add MCPB bundle for Claude Desktop installation Add Model Context Protocol Bundle (MCPB) support enabling single-click installation in Claude Desktop and other MCP hosts. Changes: - Add manifest.json with uvx-based server configuration - Add icon.png for display in Claude Desktop - Add .mcpbignore for build exclusions - Add pre-built unity-mcp.mcpb bundle 🤖 Generated with [Claude Code](https://claude.com/claude-code) * fix: Generate MCPB as release artifact instead of committing to repo Address review feedback from @msanatan: - Remove pre-built unity-mcp.mcpb and icon.png from repository - Add tools/generate_mcpb.py script for bundle generation - Update release.yml with new publish_mcpb job that: - Generates bundle using generate_mcpb.py - Uploads MCPB file as release artifact - Update manifest.json to reference icon from docs/images/ The bundle is now generated automatically on each release, keeping the repository clean while providing download artifacts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) * fix: Use correct mcpb pack CLI syntax (positional args) The mcpb CLI uses 'mcpb pack [directory] [output]' syntax, not '--output' flag. Tested locally - bundle generates correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: triepod-ai <199543909+triepod-ai@users.noreply.github.com>
Replace inline sed/jq commands in release workflow with tools/update_versions.py script that: - Updates MCPForUnity/package.json, manifest.json, Server/pyproject.toml - Updates version references in Server/README.md, README.md, docs/i18n/README-zh.md - Supports --dry-run and --version flags - Auto-detects version from package.json if not specified - Provides better error handling and progress output
Add comprehensive documentation for the version update process in both English and Chinese development guides: - Document manifest.json and package.json version synchronization during releases - Explain update_versions.py script usage with examples (default, --version, --dry-run) - List all files updated by the script (package.json, manifest.json, pyproject.toml, READMEs) - Provide guidance on manual tool updates outside release
Add automated documentation update workflow to ensure consistency when tools/resources change: - Add UPDATE_DOCS_PROMPT.md with copy-paste LLM prompt that: - Instructs LLM to scan Server/src/services/tools/ and resources/ for decorators - Updates manifest.json tools array, README.md tools/resources sections, README-zh.md - Enforces alphabetical ordering and formatting rules (backticks, bullets) - References check_docs_sync.py for
* feat: add release workflow concurrency control and main-to-beta sync Add safeguards to prevent concurrent releases and ensure beta stays in sync: - Add concurrency group to prevent overlapping release runs - Enforce workflow runs only on main branch (fail if run elsewhere) - Explicitly checkout and push to main (not dynamic branch) - Fail if release tag already exists (was silently skipping) - Add sync_beta job that merges main back into beta after release - Add docs/guides/RELEASING.md with two * feat: use PRs for version bumps and beta sync instead of direct pushes For release notes to work we need for PRs from beta to main to not be squashed. We also want to enforce all changes to be via PRs, for humans. But that also limits GH Actions. An alternative is creating a GH App with bypass permissions but that felt like overkill Replace direct pushes to main/beta with PR-based workflow for better branch protection compatibility: - Create temporary release/vX.Y.Z branch for version bump - Open PR from release branch into main, enable auto-merge - Poll for PR merge completion (up to 2 minutes) before creating tag - Fetch merged main and create tag on merged commit - Clean up release branch after tag creation - Create PR to merge main into beta (skip if already
Reviewer's GuideRefactors the release workflow to enforce running on main, centralizes version bumping via a new update_versions.py script, introduces automated PR-based merging and branch syncing between main and beta, publishes a new MCPB bundle artifact, and adds documentation/templates to support the new release and tooling workflow. Sequence diagram for the new release workflow and branch syncsequenceDiagram
actor Maintainer
participant GitHubActions as GitHub_Actions
participant BumpJob as Job_bump
participant SyncBetaJob as Job_sync_beta
participant PublishDocker as Job_publish_docker
participant PublishPyPI as Job_publish_pypi
participant PublishMCPB as Job_publish_mcpb
participant GitHubPR as GitHub_PRs
participant GitBranches as Git_branches_and_tags
participant GitHubRelease as GitHub_Releases
Maintainer->>GitHubActions: Manually trigger Release workflow on branch main
GitHubActions->>BumpJob: Start bump job
BumpJob->>GitBranches: Check GITHUB_REF_NAME is main
BumpJob->>GitBranches: Checkout main
BumpJob->>BumpJob: Compute new_version and tag
BumpJob->>BumpJob: Run update_versions.py with new_version
BumpJob->>GitBranches: Create branch release/vX.Y.Z with version bump commit
BumpJob->>GitBranches: Push release/vX.Y.Z to origin
BumpJob->>GitHubPR: Create PR head=release/vX.Y.Z base=main
BumpJob->>GitHubPR: Enable auto merge for bump PR
GitHubPR-->>BumpJob: PR merged (after checks) or merge attempted directly
BumpJob->>GitBranches: Fetch and checkout merged main
BumpJob->>GitBranches: Create annotated tag vX.Y.Z on main
BumpJob->>GitBranches: Push tag vX.Y.Z
BumpJob->>GitBranches: Delete release/vX.Y.Z branch on origin (cleanup)
BumpJob->>GitHubRelease: Create GitHub Release for vX.Y.Z
BumpJob-->>SyncBetaJob: Output new_version and tag
BumpJob-->>PublishDocker: Output tag
BumpJob-->>PublishPyPI: Output tag
BumpJob-->>PublishMCPB: Output new_version and tag
GitHubActions->>SyncBetaJob: Start sync_beta job (needs bump)
SyncBetaJob->>GitBranches: Fetch main and beta
SyncBetaJob->>SyncBetaJob: Check if beta is behind main
alt beta is behind main
SyncBetaJob->>GitHubPR: Create PR head=main base=beta
SyncBetaJob->>GitHubPR: Enable auto merge
GitHubPR-->>SyncBetaJob: Sync PR merged or merged directly
else beta up to date
SyncBetaJob-->>GitHubActions: Skip sync PR
end
GitHubActions->>PublishDocker: Start publish_docker job (needs bump)
PublishDocker->>GitBranches: Checkout tag vX.Y.Z
PublishDocker->>PublishDocker: Build and push Docker image
GitHubActions->>PublishPyPI: Start publish_pypi job (needs bump)
PublishPyPI->>GitBranches: Checkout tag vX.Y.Z
PublishPyPI->>PublishPyPI: Build and upload package to PyPI
GitHubActions->>PublishMCPB: Start publish_mcpb job (needs bump)
PublishMCPB->>GitBranches: Checkout tag vX.Y.Z
PublishMCPB->>PublishMCPB: Generate unity-mcp-X.Y.Z.mcpb
PublishMCPB->>GitHubRelease: Attach .mcpb file to release vX.Y.Z
Class diagram for new tooling scripts update_versions.py and generate_mcpb.pyclassDiagram
class UpdateVersionsScript {
+Path REPO_ROOT
+Path PACKAGE_JSON
+Path MANIFEST_JSON
+Path PYPROJECT_TOML
+Path SERVER_README
+Path ROOT_README
+Path ZH_README
+str load_package_version()
+bool update_package_json(new_version, dry_run)
+bool update_manifest_json(new_version, dry_run)
+bool update_pyproject_toml(new_version, dry_run)
+bool update_server_readme(new_version, dry_run)
+bool update_root_readme(new_version, dry_run)
+bool update_zh_readme(new_version, dry_run)
+int main()
}
class GenerateMcpbScript {
+Path REPO_ROOT
+Path DEFAULT_ICON
+Path MANIFEST_TEMPLATE
+dict create_manifest(version, icon_filename)
+Path generate_mcpb(version, output_path, icon_path)
+int main()
}
class ManifestJson {
+string manifest_version
+string name
+string version
+string description
+string icon
+object author
+object repository
+object server
+ToolEntry[] tools
}
class ToolEntry {
+string name
+string description
}
UpdateVersionsScript --> ManifestJson : synchronizes_version
GenerateMcpbScript --> ManifestJson : reads_template_and_embeds
ManifestJson "1" o-- "many" ToolEntry : contains
Flow diagram for bump job logic in the release workflowflowchart TD
A["Start bump job"] --> B["Check GITHUB_REF_NAME == main"]
B -->|No| Z["Fail: workflow must run on main"]
B -->|Yes| C["Checkout main with fetch-depth 0"]
C --> D["Compute new_version and tag from inputs"]
D --> E["Run python3 tools/update_versions.py --version new_version"]
E --> F["Create branch name release/vX.Y.Z"]
F --> G["Configure git user"]
G --> H["Checkout new branch release/vX.Y.Z"]
H --> I["git add versioned files including manifest.json"]
I --> J{Any staged changes?}
J -->|No| K["Log 'No version changes to commit'"]
J -->|Yes| L["Commit 'chore: bump version to new_version'"]
K --> M
L --> M["Push branch release/vX.Y.Z to origin"]
M --> N["Create PR head=release/vX.Y.Z base=main"]
N --> O["Enable auto-merge on PR"]
O --> P["Poll PR state up to timeout"]
P --> Q{PR merged?}
Q -->|Yes| R["Proceed to tagging"]
Q -->|No| S["Attempt direct merge via gh pr merge"]
S --> R
R --> T["git fetch origin main"]
T --> U["git checkout main"]
U --> V["git pull origin main"]
V --> W{Does tag already exist on remote?}
W -->|Yes| X["Fail: tag already exists, refuse to release"]
W -->|No| Y["Create annotated tag and push to origin"]
Y --> AA["Create GitHub release for tag"]
AA --> AB["Delete remote branch release/vX.Y.Z (best-effort)"]
AB --> AC["End bump job"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Hey - I've found 2 issues, and left some high level feedback:
- In
tools/update_versions.py, the--update-packageargument is declared but never used, and the actual behavior is to always updateMCPForUnity/package.jsonwhen--versionis provided; either wire the flag into the logic or remove/adjust it and the help text to avoid confusing consumers of the script.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `tools/update_versions.py`, the `--update-package` argument is declared but never used, and the actual behavior is to always update `MCPForUnity/package.json` when `--version` is provided; either wire the flag into the logic or remove/adjust it and the help text to avoid confusing consumers of the script.
## Individual Comments
### Comment 1
<location> `.github/pull_request_template.md:22-23` </location>
<code_context>
+## Documentation Updates
+<!-- Check if you updated documentation for tools/resources changes -->
+- [ ] I have added/removed/modified tools or resources
+- [ ] If yes, I have updated all documentation files using:
</code_context>
<issue_to_address>
**suggestion (typo):** Rephrase this sentence for clearer grammar
Suggest rephrasing to: "Check if you updated documentation for tool/resource changes" or "for changes to tools/resources," as "for tools/resources changes" is a bit awkward grammatically.
```suggestion
## Documentation Updates
<!-- Check if you updated documentation for changes to tools/resources -->
```
</issue_to_address>
### Comment 2
<location> `tools/UPDATE_DOCS_PROMPT.md:7-8` </location>
<code_context>
+## Example Usage
+
+After adding a new tool called "manage_new_feature" and a new resource called "feature_resource", you would:
+1. Copy the prompt above
+2. Paste it into your LLM
+3. The LLM will analyze the codebase and update all documentation files
</code_context>
<issue_to_address>
**suggestion (typo):** “Copy the prompt above” may be misleading since the prompt is defined below
Here you reference “the prompt above,” but the actual prompt text appears later under the `## Prompt` heading. To reduce confusion, please update this wording (e.g., “Copy the prompt below” or “Copy the prompt in the section below”).
```suggestion
After adding a new tool called "manage_new_feature" and a new resource called "feature_resource", you would:
1. Copy the prompt in the section below
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@msanatan Do you want to tell people in the main README that they can grab the beta if they use its branch URL when pulling the package? |
Good question! Why not, we give them an example of installing a fixed version, so we can tell them how to install the |
Yes and I think we can get rid of the fixed version idea too. Main is the fixed / stable version. So stable is default but beta is de fun. |
…branch Remove version-specific installation examples from README.md and README-zh.md, replacing with beta branch references. Update release workflow and update_versions.py to stop modifying README files during version bumps since they no longer contain version-specific URLs.
Description
Type of Change
Save your change type
Changes Made
Testing/Screenshots/Recordings
Documentation Updates
tools/UPDATE_DOCS_PROMPT.md(recommended)tools/UPDATE_DOCS.mdRelated Issues
Additional Notes
Summary by Sourcery
Automate and harden the release workflow around the main and beta branches, centralize version management, and add support for publishing an MCP bundle artifact with updated documentation and metadata.
Enhancements:
Build:
Documentation:
Chores: