Skip to content

Commit df07716

Browse files
authored
Merge pull request #219 from msanatan/feature/open-upm
Adjust the package before publishing on OpenUPM
2 parents b33ae0b + ed63c24 commit df07716

File tree

3 files changed

+120
-5
lines changed

3 files changed

+120
-5
lines changed

.github/workflows/bump-version.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Bump Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_bump:
7+
description: "Version bump type"
8+
type: choice
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
default: patch
14+
required: true
15+
16+
jobs:
17+
bump:
18+
name: "Bump version and tag"
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Compute new version
29+
id: compute
30+
shell: bash
31+
run: |
32+
set -euo pipefail
33+
BUMP="${{ inputs.version_bump }}"
34+
CURRENT_VERSION=$(jq -r '.version' "UnityMcpBridge/package.json")
35+
echo "Current version: $CURRENT_VERSION"
36+
37+
IFS='.' read -r MA MI PA <<< "$CURRENT_VERSION"
38+
case "$BUMP" in
39+
major)
40+
((MA+=1)); MI=0; PA=0
41+
;;
42+
minor)
43+
((MI+=1)); PA=0
44+
;;
45+
patch)
46+
((PA+=1))
47+
;;
48+
*)
49+
echo "Unknown version_bump: $BUMP" >&2
50+
exit 1
51+
;;
52+
esac
53+
54+
NEW_VERSION="$MA.$MI.$PA"
55+
echo "New version: $NEW_VERSION"
56+
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
57+
echo "current_version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
58+
59+
- name: Update files to new version
60+
env:
61+
NEW_VERSION: ${{ steps.compute.outputs.new_version }}
62+
shell: bash
63+
run: |
64+
set -euo pipefail
65+
66+
echo "Updating UnityMcpBridge/package.json to $NEW_VERSION"
67+
jq ".version = \"${NEW_VERSION}\"" UnityMcpBridge/package.json > UnityMcpBridge/package.json.tmp
68+
mv UnityMcpBridge/package.json.tmp UnityMcpBridge/package.json
69+
70+
echo "Updating UnityMcpBridge/UnityMcpServer~/src/pyproject.toml to $NEW_VERSION"
71+
sed -i '0,/^version = ".*"/s//version = "'"$NEW_VERSION"'"/' "UnityMcpBridge/UnityMcpServer~/src/pyproject.toml"
72+
73+
- name: Commit and push changes
74+
env:
75+
NEW_VERSION: ${{ steps.compute.outputs.new_version }}
76+
shell: bash
77+
run: |
78+
set -euo pipefail
79+
git config user.name "GitHub Actions"
80+
git config user.email "[email protected]"
81+
git add UnityMcpBridge/package.json "UnityMcpBridge/UnityMcpServer~/src/pyproject.toml"
82+
if git diff --cached --quiet; then
83+
echo "No version changes to commit."
84+
else
85+
git commit -m "chore: bump version to ${NEW_VERSION}"
86+
fi
87+
88+
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
89+
echo "Pushing to branch: $BRANCH"
90+
git push origin "$BRANCH"
91+
92+
- name: Create and push tag
93+
env:
94+
NEW_VERSION: ${{ steps.compute.outputs.new_version }}
95+
shell: bash
96+
run: |
97+
set -euo pipefail
98+
TAG="v${NEW_VERSION}"
99+
echo "Preparing to create tag $TAG"
100+
101+
if git ls-remote --tags origin | grep -q "refs/tags/$TAG$"; then
102+
echo "Tag $TAG already exists on remote. Skipping tag creation."
103+
exit 0
104+
fi
105+
106+
git tag -a "$TAG" -m "Version ${NEW_VERSION}"
107+
git push origin "$TAG"

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Unity MCP connects your tools using two components:
6565
### Prerequisites
6666

6767
* **Python:** Version 3.12 or newer. [Download Python](https://www.python.org/downloads/)
68-
* **Unity Hub & Editor:** Version 2020.3 LTS or newer. [Download Unity](https://unity.com/download)
68+
* **Unity Hub & Editor:** Version 2021.3 LTS or newer. [Download Unity](https://unity.com/download)
6969
* **uv (Python package manager):**
7070
```bash
7171
pip install uv
@@ -99,7 +99,9 @@ Unity MCP connects your tools using two components:
9999

100100
**Note:** Without Roslyn, script validation falls back to basic structural checks. Roslyn enables full C# compiler diagnostics with precise error reporting.</details>
101101

102-
### 🌟Step 1: Install the Unity Package (Bridge)🌟
102+
### 🌟Step 1: Install the Unity Package🌟
103+
104+
#### To install via Git URL
103105

104106
1. Open your Unity project.
105107
2. Go to `Window > Package Manager`.
@@ -111,6 +113,12 @@ Unity MCP connects your tools using two components:
111113
5. Click `Add`.
112114
6. The MCP Server should automatically be installed onto your machine as a result of this process.
113115

116+
#### To install via OpenUPM
117+
118+
1. Instal the [OpenUPM CLI](https://openupm.com/docs/getting-started-cli.html)
119+
2. Open a terminal (PowerShell, Terminal, etc.) and navigate to your Unity project directory
120+
3. Run `openupm add com.coplaydev.unity-mcp`
121+
114122
**Note:** If you installed the MCP Server before Coplay's maintenance, you will need to uninstall the old package before re-installing the new one.
115123
116124
### Step 2: Configure Your MCP Client

UnityMcpBridge/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "com.coplaydev.unity-mcp",
33
"version": "2.1.1",
4-
"displayName": "Unity MCP Bridge",
5-
"description": "A bridge that manages and communicates with the sister application, Unity MCP Server, which allows for communications with MCP Clients like Claude Desktop or Cursor.",
6-
"unity": "2020.3",
4+
"displayName": "Unity MCP",
5+
"description": "A bridge that connects an LLM to Unity via the MCP (Model Context Protocol). This allows MCP Clients like Claude Desktop or Cursor to directly control your Unity Editor.",
6+
"unity": "2021.3",
77
"documentationUrl": "https://github.com/CoplayDev/unity-mcp",
88
"licensesUrl": "https://github.com/CoplayDev/unity-mcp/blob/main/LICENSE",
99
"dependencies": {

0 commit comments

Comments
 (0)