diff --git a/.claude-plugin/plugins/unity-cli/skills/unity-cli-usage/SKILL.md b/.claude-plugin/plugins/unity-cli/skills/unity-cli-usage/SKILL.md index fbba255..3f0c89d 100644 --- a/.claude-plugin/plugins/unity-cli/skills/unity-cli-usage/SKILL.md +++ b/.claude-plugin/plugins/unity-cli/skills/unity-cli-usage/SKILL.md @@ -14,13 +14,12 @@ Before running any Unity command, ensure `unity-cli` is available: ```bash if ! command -v unity-cli >/dev/null 2>&1; then - if command -v cargo >/dev/null 2>&1; then - cargo install unity-cli - hash -r - elif [ -f Cargo.toml ] && grep -q '^name = "unity-cli"' Cargo.toml; then + if [ -f Cargo.toml ] && grep -q '^name = "unity-cli"' Cargo.toml; then echo "unity-cli is not installed globally. Use: cargo run -- " else - echo "Install Rust first: https://rustup.rs" + echo "unity-cli is not installed." + echo "Install a release binary from https://github.com/akiojin/unity-cli/releases" + echo "or clone the repo and run: cargo install --path ." exit 1 fi fi diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 7547979..cb8ecdd 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -13,9 +13,9 @@ - `dotnet test lsp/Server.Tests.csproj` - `cargo llvm-cov` (Rust coverage gate, line >= 90%) - `dotnet test ... /p:CollectCoverage=true` (LSP coverage gate, line >= 90%) -- `unity-cli-release.yml` - - triggers on `v*` tag - - builds release binaries for Linux/macOS/Windows +- `release.yml` + - runs after `chore(release):` pushes to `main` or manual dispatch + - creates the release tag, builds release binaries for Linux/macOS/Windows - publishes GitHub Release assets - `specs-readme.yml` - verifies `specs/specs.md` is in sync with Spec Kit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1216bdf..d8b7c8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -93,6 +93,12 @@ jobs: lsp-perf: name: LSP Performance (required) runs-on: ubuntu-latest + if: >- + !( + github.event_name == 'push' + && github.ref == 'refs/heads/main' + && contains(github.event.head_commit.message, 'chore(release):') + ) steps: - uses: actions/checkout@v6 diff --git a/CHANGELOG.md b/CHANGELOG.md index c83c792..719a475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.2.4] - 2026-03-06 + +### 🐛 Bug Fixes + +- *(ci)* Skip lsp-perf job on release commits to avoid 404 race condition +- *(release)* Publish crate and align install docs ## [0.2.3] - 2026-03-05 ### 🚀 Features diff --git a/CLAUDE.md b/CLAUDE.md index 6ad4b9b..93d9057 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -103,10 +103,10 @@ dotnet test lsp/Server.Tests.csproj ## リリース -- バージョン同期: `node scripts/release/update-versions.mjs ` +- リリース実行: `./scripts/publish.sh ` - タグ: `vX.Y.Z` -- GitHub Actions: `.github/workflows/unity-cli-release.yml` -- crates.io 公開: `cargo publish` +- GitHub Actions: `.github/workflows/release.yml` +- crates.io 公開: `scripts/publish.sh` が `cargo publish` を実行 ## 主要ディレクトリ diff --git a/Cargo.lock b/Cargo.lock index 23f2000..6ae280e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1043,7 +1043,7 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unity-cli" -version = "0.2.3" +version = "0.2.4" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index ab1b257..7a430fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unity-cli" -version = "0.2.3" +version = "0.2.4" edition = "2021" description = "Rust CLI for Unity Editor automation over the Unity TCP protocol" readme = "README.md" diff --git a/README.de.md b/README.de.md index 75b36e9..6183ed7 100644 --- a/README.de.md +++ b/README.de.md @@ -32,7 +32,8 @@ Installieren Sie das `unity-cli` Plugin aus dem Claude Code Marketplace: /plugin marketplace add akiojin/unity-cli ``` -Wenn `cargo` verfugbar ist, kann das Plugin Setup `unity-cli` automatisch installieren oder aktualisieren. +Das Marketplace Plugin installiert nur Skills. Installieren Sie das +`unity-cli` Binary separat mit einer der manuellen Optionen unten. ### Codex Skills @@ -41,8 +42,14 @@ Es ist keine zusatzliche Einrichtung erforderlich — klonen Sie einfach das Rep ### Manuelle Installation +Laden Sie das neueste Binary von [GitHub +Releases](https://github.com/akiojin/unity-cli/releases) herunter oder +installieren Sie es aus einem lokalen Checkout: + ```bash -cargo install unity-cli +git clone https://github.com/akiojin/unity-cli.git +cd unity-cli +cargo install --path . ``` UPM Paket URL auf Unity Seite: diff --git a/README.es.md b/README.es.md index f20af47..6be9560 100644 --- a/README.es.md +++ b/README.es.md @@ -32,7 +32,8 @@ Instala el plugin `unity-cli` desde Claude Code Marketplace: /plugin marketplace add akiojin/unity-cli ``` -Si `cargo` esta disponible, la configuracion del plugin puede instalar o actualizar `unity-cli` automaticamente. +El plugin del Marketplace instala solo los skills. Instala el binario +`unity-cli` por separado con una de las opciones manuales de abajo. ### Codex Skills @@ -41,8 +42,14 @@ No se requiere configuracion adicional — solo clona el repositorio. ### Instalacion manual +Descarga el binario mas reciente desde [GitHub +Releases](https://github.com/akiojin/unity-cli/releases), o instalalo desde +un clon local: + ```bash -cargo install unity-cli +git clone https://github.com/akiojin/unity-cli.git +cd unity-cli +cargo install --path . ``` URL del paquete UPM para Unity: diff --git a/README.fr.md b/README.fr.md index fe7d87d..1c899c3 100644 --- a/README.fr.md +++ b/README.fr.md @@ -32,7 +32,8 @@ Installez le plugin `unity-cli` depuis la Marketplace de Claude Code: /plugin marketplace add akiojin/unity-cli ``` -Si `cargo` est disponible, l installation du plugin peut installer ou mettre a jour automatiquement `unity-cli`. +Le plugin Marketplace installe uniquement les skills. Installez le binaire +`unity-cli` separement avec l une des options manuelles ci-dessous. ### Codex Skills @@ -41,8 +42,14 @@ Aucune configuration supplementaire n est necessaire — il suffit de cloner le ### Installation manuelle +Telechargez le dernier binaire depuis [GitHub +Releases](https://github.com/akiojin/unity-cli/releases), ou installez-le +depuis un clone local: + ```bash -cargo install unity-cli +git clone https://github.com/akiojin/unity-cli.git +cd unity-cli +cargo install --path . ``` URL du package UPM cote Unity: diff --git a/README.it.md b/README.it.md index 1e2777e..dbd643c 100644 --- a/README.it.md +++ b/README.it.md @@ -32,7 +32,8 @@ Installa il plugin `unity-cli` dal Claude Code Marketplace: /plugin marketplace add akiojin/unity-cli ``` -Se `cargo` e disponibile, il setup del plugin puo installare o aggiornare automaticamente `unity-cli`. +Il plugin del Marketplace installa solo gli skill. Installa il binario +`unity-cli` separatamente con una delle opzioni manuali qui sotto. ### Codex Skills @@ -41,8 +42,14 @@ Non e necessaria alcuna configurazione aggiuntiva — basta clonare il repositor ### Installazione manuale +Scarica il binary piu recente da [GitHub +Releases](https://github.com/akiojin/unity-cli/releases), oppure installalo da +un clone locale: + ```bash -cargo install unity-cli +git clone https://github.com/akiojin/unity-cli.git +cd unity-cli +cargo install --path . ``` URL del pacchetto UPM lato Unity: diff --git a/README.ja.md b/README.ja.md index c02c21b..5c0be47 100644 --- a/README.ja.md +++ b/README.ja.md @@ -32,7 +32,8 @@ Claude Code Marketplace から `unity-cli` プラグインをインストール /plugin marketplace add akiojin/unity-cli ``` -`cargo` が利用可能な環境では、プラグインセットアップ時に `unity-cli` を自動インストールまたは更新できます。 +Marketplace プラグインがインストールするのはスキルのみです。 +`unity-cli` バイナリ自体は、以下の手動手順のいずれかで別途導入してください。 ### Codex スキル @@ -41,8 +42,14 @@ Codex でこのリポジトリを利用する場合、`.codex/skills/` にスキ ### 手動インストール +最新バイナリは [GitHub +Releases](https://github.com/akiojin/unity-cli/releases) から取得できます。 +Cargo を使う場合は、ローカル clone からインストールしてください: + ```bash -cargo install unity-cli +git clone https://github.com/akiojin/unity-cli.git +cd unity-cli +cargo install --path . ``` Unity 側 UPM パッケージ URL: diff --git a/README.md b/README.md index d7bb377..1084a54 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ Install the `unity-cli` plugin from Claude Code Marketplace: /plugin marketplace add akiojin/unity-cli ``` -When `cargo` is available, plugin setup can install or update `unity-cli` automatically. +The marketplace plugin installs skills only. Install the `unity-cli` binary +separately using one of the manual options below. ### Codex Skills @@ -41,8 +42,14 @@ No additional setup is required — just clone the repository. ### Manual Install +Download the latest binary from [GitHub +Releases](https://github.com/akiojin/unity-cli/releases), or install from a +local checkout: + ```bash -cargo install unity-cli +git clone https://github.com/akiojin/unity-cli.git +cd unity-cli +cargo install --path . ``` Unity-side UPM package URL: diff --git a/README.zh.md b/README.zh.md index dc4a6ff..4d1699d 100644 --- a/README.zh.md +++ b/README.zh.md @@ -32,7 +32,7 @@ Claude Code /plugin marketplace add akiojin/unity-cli ``` -如果环境中可用 `cargo`,插件安装流程可自动安装或更新 `unity-cli`。 +Marketplace 插件只会安装 skills。`unity-cli` 二进制本体需要使用下面的手动方式之一单独安装。 ### Codex Skills @@ -41,8 +41,13 @@ Claude Code ### 手动安装 +可以从 [GitHub Releases](https://github.com/akiojin/unity-cli/releases) +下载最新二进制,或者从本地 clone 安装: + ```bash -cargo install unity-cli +git clone https://github.com/akiojin/unity-cli.git +cd unity-cli +cargo install --path . ``` Unity 侧 UPM 包 URL: diff --git a/RELEASE.md b/RELEASE.md index db00422..25ea075 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -5,138 +5,130 @@ Run the publish script from the repository root: ```bash -./scripts/publish.sh 0.2.0 +./scripts/publish.sh patch ``` -The script automates the full release pipeline: +`scripts/publish.sh` is the release entrypoint. It: -1. Validates clean working tree and `main` branch -2. Verifies `Cargo.toml` version matches the target version -3. Runs `cargo test` and `dotnet test lsp/Server.Tests.csproj` -4. Performs `cargo publish --dry-run` to catch packaging issues -5. Prompts for confirmation -6. Publishes the crate to crates.io via `cargo publish` -7. Creates and pushes the git tag `vX.Y.Z` +1. Verifies the working tree is clean +2. Bumps the workspace version with `npm version ` +3. Syncs the Unity package and LSP versions +4. Runs `cargo test`, `dotnet test lsp/Server.Tests.csproj`, and `cargo publish --dry-run` +5. Commits the version sync, creates `vX.Y.Z`, and runs `cargo publish` +6. Pushes the release commit and tag -Once the tag is pushed, **GitHub Actions** automatically: - -1. Validates the tag and runs the test suite -2. Builds release binaries for linux-x64, macos-arm64, and windows-x64 -3. Creates a GitHub Release with the built artifacts +After the push, GitHub Actions `release.yml` builds the release binaries and uploads the GitHub Release assets. ## Tag Convention -All release tags use the format `vX.Y.Z` (e.g. `v0.1.0`, `v1.0.0`). +All release tags use the format `vX.Y.Z` (for example `v0.2.3`). ## Release Workflow Details ### `scripts/publish.sh` -Pre-publish validation script. Accepts a version argument without the `v` prefix: +Usage: ```bash -./scripts/publish.sh +./scripts/publish.sh [--tags-only|--no-push] [--remote ] ``` -Checks performed before publishing: +Checks performed before publish: | Step | Description | -| ------ | ------------- | +| --- | --- | | 1 | Git working tree is clean (no uncommitted or untracked files) | -| 2 | Current branch is `main` | -| 3 | `Cargo.toml` version matches the provided version | -| 4 | Tag `vX.Y.Z` does not already exist | -| 5 | `cargo test` passes | -| 6 | `dotnet test lsp/Server.Tests.csproj` passes | -| 7 | `cargo publish --dry-run` succeeds | +| 2 | `node` is available for the version bump | +| 3 | `cargo test` passes | +| 4 | `dotnet test lsp/Server.Tests.csproj` passes | +| 5 | `cargo publish --dry-run` succeeds | +| 6 | `cargo publish` succeeds | + +The script then creates the annotated tag `vX.Y.Z` and pushes the commit and tag to the selected remote. ### `.github/workflows/release.yml` Triggered by: -- **Tag push**: Pushing a `v*` tag (created by `publish.sh`) -- **Manual dispatch**: Enter the `release_tag` (e.g. `v0.2.0`) in the GitHub Actions UI +- Pushes to `main` whose commit message contains `chore(release):` +- Manual dispatch from the GitHub Actions UI Jobs: | Job | Description | -| ----- | ------------- | -| `validate` | Checks tag format, verifies Cargo.toml version, runs cargo test and dotnet test | -| `build` | Matrix build for linux-x64, macos-arm64, windows-x64 | -| `release` | Creates a GitHub Release and attaches the built binaries | +| --- | --- | +| `create-tag` | Creates the release tag if it does not exist yet | +| `build` | Matrix build for `unity-cli` release binaries | +| `build-lsp` | Matrix build for the bundled C# LSP binaries | +| `upload-release` | Uploads all built artifacts to the GitHub Release | -Release artifacts: +Release artifacts include: - `unity-cli-linux-x64` +- `unity-cli-linux-arm64` - `unity-cli-macos-arm64` - `unity-cli-windows-x64.exe` +- `csharp-lsp-linux-x64` +- `csharp-lsp-linux-arm64` +- `csharp-lsp-osx-arm64` +- `csharp-lsp-win-x64` +- `csharp-lsp-manifest.json` ## Step-by-Step Release Checklist -1. Ensure all changes are merged to `main` -2. Update `version` in `Cargo.toml` to the new version -3. Commit the version bump: `git commit -am "chore: bump version to X.Y.Z"` -4. Run the publish script: +1. Ensure the release changes are merged and the working tree is clean +2. Run: + ```bash - ./scripts/publish.sh X.Y.Z + ./scripts/publish.sh patch ``` -5. Confirm the prompt to publish and push -6. Verify the GitHub Actions [Release workflow](../../actions/workflows/release.yml) completes -7. Verify the [GitHub Release](../../releases) page has the correct artifacts + +3. Verify the [Release workflow](../../actions/workflows/release.yml) succeeds +4. Verify the crate appears on crates.io +5. Verify the [GitHub Release](../../releases) page contains the expected assets ## Troubleshooting ### `publish.sh` fails with "working tree is not clean" -Commit or stash all changes before running the script: - -```bash -git stash # or git commit -./scripts/publish.sh X.Y.Z -``` - -### `publish.sh` fails with "Must be on 'main' branch" - -Switch to the main branch first: +Commit or remove the pending changes, then rerun: ```bash -git checkout main -git pull origin main -./scripts/publish.sh X.Y.Z +git status --short +./scripts/publish.sh patch ``` -### `publish.sh` fails with "Cargo.toml version is '...' but release version is '...'" +### `publish.sh` fails with `dotnet test` -Update `Cargo.toml` to match the version you want to release: +Install the required .NET SDK and rerun: ```bash -# Edit Cargo.toml, set version = "X.Y.Z" -git commit -am "chore: bump version to X.Y.Z" -./scripts/publish.sh X.Y.Z +dotnet --info +./scripts/publish.sh patch ``` ### `cargo publish` fails with authentication error -Ensure you are logged in to crates.io: +Log in to crates.io on the release machine: ```bash cargo login +./scripts/publish.sh patch ``` ### GitHub Actions release workflow fails -- Check the [Actions tab](../../actions/workflows/release.yml) for detailed logs -- For manual re-trigger, use **workflow_dispatch** with the release tag -- If the tag was pushed but the workflow failed, fix the issue and re-run the workflow from the Actions UI +- Check the [Actions tab](../../actions/workflows/release.yml) for logs +- Re-run the failed workflow from GitHub Actions after fixing the issue +- If assets are missing, verify the release tag exists on the remote ### Tag already exists -If you need to re-release the same version: +If the release tag was created locally but not pushed successfully: ```bash -git tag -d vX.Y.Z # delete local tag -git push origin :refs/tags/vX.Y.Z # delete remote tag -./scripts/publish.sh X.Y.Z # re-run +git tag -d vX.Y.Z +./scripts/publish.sh patch ``` -Note: You cannot re-publish the same version to crates.io. If the crate was already published, you must bump the version. +If the crate was already published to crates.io, you must bump the version before retrying. diff --git a/UnityCliBridge/Packages/unity-cli-bridge/package.json b/UnityCliBridge/Packages/unity-cli-bridge/package.json index a57589e..3e527dc 100644 --- a/UnityCliBridge/Packages/unity-cli-bridge/package.json +++ b/UnityCliBridge/Packages/unity-cli-bridge/package.json @@ -1,7 +1,7 @@ { "name": "com.akiojin.unity-cli-bridge", "displayName": "Unity CLI Bridge", - "version": "0.2.3", + "version": "0.2.4", "unity": "6000.0", "description": "Unity Editor bridge package for unity-cli automation (screenshots, video capture, scene analysis, input automation).", "keywords": [ diff --git a/docs/development.md b/docs/development.md index e250ad1..f7e7f38 100644 --- a/docs/development.md +++ b/docs/development.md @@ -400,10 +400,10 @@ bash scripts/sync-constitution.sh --check ## Release Flow -1. Update versions: `node scripts/release/update-versions.mjs ` -2. Tag: `vX.Y.Z` -3. Push tag and run `.github/workflows/unity-cli-release.yml` -4. Publish crate: `cargo publish` +1. Run `./scripts/publish.sh ` +2. Confirm the new `vX.Y.Z` tag was pushed +3. Verify `.github/workflows/release.yml` uploaded the release binaries +4. Verify the crate is available on crates.io Detailed steps: `RELEASE.md`. @@ -861,10 +861,10 @@ bash scripts/sync-constitution.sh --check ## リリースフロー -1. `node scripts/release/update-versions.mjs ` でバージョン同期 -2. `vX.Y.Z` タグ作成 -3. `.github/workflows/unity-cli-release.yml` でバイナリ公開 -4. `cargo publish` で crates.io 公開 +1. `./scripts/publish.sh ` を実行 +2. 新しい `vX.Y.Z` タグが push されたことを確認 +3. `.github/workflows/release.yml` でバイナリが公開されたことを確認 +4. crates.io で crate が公開されたことを確認 詳細は `RELEASE.md` を参照してください。 diff --git a/package.json b/package.json index 4531dbf..eb90832 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unity-cli-workspace", - "version": "0.2.3", + "version": "0.2.4", "private": true, "packageManager": "pnpm@9.15.4", "description": "Development environment for unity-cli", diff --git a/scripts/e2e-all-tools.sh b/scripts/e2e-all-tools.sh index 884f2d4..c0b83c4 100755 --- a/scripts/e2e-all-tools.sh +++ b/scripts/e2e-all-tools.sh @@ -132,7 +132,7 @@ if [[ -z "${UNITY_CLI}" ]]; then fi if [[ -z "${UNITY_CLI}" || ! -x "${UNITY_CLI}" ]]; then - echo "ERROR: unity-cli not found. Build with 'cargo build --release' or install from crates.io." >&2 + echo "ERROR: unity-cli not found. Build with 'cargo build --release' or install a release binary." >&2 exit 1 fi diff --git a/scripts/publish.sh b/scripts/publish.sh index 3eca811..ad91d9e 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -7,8 +7,9 @@ set -euo pipefail # 単一入口で以下を実施: # 1) バージョン更新(CLI/LSP/Unity の全て) # 2) タグ付けとコミット&プッシュ -# 期待動作(CI): -# - Release binary(各OS向けビルド) +# 期待動作: +# - ローカルで crates.io に publish +# - GitHub Actions で Release binary(各OS向けビルド) usage() { echo "Usage: $0 [--tags-only|--no-push] [--remote ]"; exit 1; } @@ -156,6 +157,9 @@ else git tag -a "$TAG" -m "$TAG" fi +echo "[step] running cargo publish..." +cargo publish || { echo "[error] cargo publish failed. Release not pushed." >&2; exit 1; } + # ────────────────────────────────────────────── # Push # ────────────────────────────────────────────── @@ -206,5 +210,5 @@ else fi fi -echo "[done] v$NEW_VER pushed. Check GitHub Actions: unity-cli-release" -echo "- Release URL (runs): https://github.com/akiojin/unity-cli/actions/workflows/unity-cli-release.yml" +echo "[done] v$NEW_VER pushed. Check GitHub Actions: release" +echo "- Release URL (runs): https://github.com/akiojin/unity-cli/actions/workflows/release.yml" diff --git a/specs/migration-notes.md b/specs/migration-notes.md index f7dbd3c..487fe75 100644 --- a/specs/migration-notes.md +++ b/specs/migration-notes.md @@ -70,7 +70,7 @@ Unity 側の UPM パッケージは引き続き同一リポジトリ内で管理 |------|----|----| | テスト | npm test | cargo test + dotnet test | | リリース | npm publish | cargo publish + GitHub Release | -| ワークフロー | ― | `.github/workflows/unity-cli-release.yml` | +| ワークフロー | ― | `.github/workflows/release.yml` | ## 削除された機能