From 54ec5ba45d2db85cbb15f7adcca3f8fb9c919156 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Tue, 25 Nov 2025 00:22:23 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[Update]=20=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E7=AE=A1=E7=90=86:=20package.json,=20tauri.c?= =?UTF-8?q?onf.json,=20config.py=E3=81=AE=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97=E3=80=81?= =?UTF-8?q?update=5Fversion.py=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 19 ++++++++++--------- src-python/config.py | 2 +- src-tauri/tauri.conf.json | 33 +++++++++++++++++++-------------- update_version.py | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 update_version.py diff --git a/package.json b/package.json index 184d5c9a..1c66c4f5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vrct", "private": true, - "version": "0.0.0", + "version": "3.3.2", "type": "module", "scripts": { "setup-python": "install.bat", @@ -14,14 +14,15 @@ "tauri-dev": "tauri dev", "task-kill": "python task_kill.py", "clean": "python clean.py", - "dev": "npm run task-kill && npm run build-python && npm run dev-ui", - "dev-cuda": "npm run task-kill && npm run build-python-cuda && npm run dev-ui", - "dev-ui": "npm-run-all --parallel vite tauri-dev", - "build": "npm run clean && npm run build-python && npm run vite-build && npm run tauri build", - "build-cuda": "npm run clean && npm run build-python-cuda && npm run vite-build && npm run tauri build", - "release": "npm run build && python zip.py --zip_name VRCT.zip", - "release-cuda": "npm run build-cuda && python zip.py --zip_name VRCT_cuda.zip", - "release-all": "npm run release && npm run release-cuda" + "update-version": "python update_version.py", + "dev": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run dev-ui", + "dev-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run dev-ui", + "dev-ui": "npm run task-kill && npm-run-all --parallel vite tauri-dev", + "build": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run vite-build && npm run tauri build", + "build-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run vite-build && npm run tauri build", + "release": "npm run update-version && npm run build && python zip.py --zip_name VRCT.zip", + "release-cuda": "npm run update-version && npm run build-cuda && python zip.py --zip_name VRCT_cuda.zip", + "release-all": "npm run update-version && npm run release && npm run release-cuda" }, "dependencies": { "@babel/standalone": "7.27.0", diff --git a/src-python/config.py b/src-python/config.py index 3a3e7c3b..cc53ab16 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -736,7 +736,7 @@ class Config: def init_config(self): # Read Only - self._VERSION = "3.3.1" + self._VERSION = "0.0.0" if getattr(sys, 'frozen', False): self._PATH_LOCAL = os_path.dirname(sys.executable) else: diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 10b04d98..0bbba778 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "VRCT", - "version": "3.3.1", + "version": "0.0.0", "identifier": "com.vrct.app", "build": { "beforeDevCommand": "", @@ -11,20 +11,25 @@ }, "app": { "enableGTKAppId": false, - "windows": [{ - "title": "VRCT", - "center": true, - "width": 450, - "height": 220, - "minWidth": 400, - "minHeight": 200, - "transparent": true, - "decorations": false, - "shadow": false - }], + "windows": [ + { + "title": "VRCT", + "center": true, + "width": 450, + "height": 220, + "minWidth": 400, + "minHeight": 200, + "transparent": true, + "decorations": false, + "shadow": false + } + ], "security": { "csp": null, - "capabilities": ["default", "vrct-capability"] + "capabilities": [ + "default", + "vrct-capability" + ] } }, "bundle": { @@ -56,4 +61,4 @@ } } } -} +} \ No newline at end of file diff --git a/update_version.py b/update_version.py new file mode 100644 index 00000000..38b11a1a --- /dev/null +++ b/update_version.py @@ -0,0 +1,39 @@ +import json +from pathlib import Path + +def update_versions(): + root = Path(__file__).parent + + # package.jsonからバージョンを読み取る + with open(root / "package.json", "r", encoding="utf-8") as f: + package_json = json.load(f) + version = package_json["version"] + + # tauri.conf.jsonを更新 + tauri_conf_path = root / "src-tauri" / "tauri.conf.json" + with open(tauri_conf_path, "r", encoding="utf-8") as f: + tauri_conf = json.load(f) + + tauri_conf["version"] = version + + with open(tauri_conf_path, "w", encoding="utf-8") as f: + json.dump(tauri_conf, f, indent=4, ensure_ascii=False) + + # config.pyを更新 + config_path = root / "src-python" / "config.py" + with open(config_path, "r", encoding="utf-8") as f: + content = f.read() + + # VERSION行を置換 + import re + pattern = r'(self\._VERSION = ")[^"]+(")' + replacement = rf'\g<1>{version}\g<2>' + new_content = re.sub(pattern, replacement, content) + + with open(config_path, "w", encoding="utf-8") as f: + f.write(new_content) + + print(f"✓ バージョン {version} に更新しました") + +if __name__ == "__main__": + update_versions() \ No newline at end of file From ff6ac43feebb12298df2906044817da3456ed2f1 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:20:55 +0900 Subject: [PATCH 2/4] [Update] Build scripts and configuration: Added new build and install scripts, updated versioning in config files, and improved project structure. --- bat/build.bat | 2 ++ bat/build_cuda.bat | 2 ++ install.bat => bat/install.bat | 0 build.bat | 2 -- build_cuda.bat | 2 -- clean.py | 6 ------ package.json | 16 ++++++++-------- backend_cuda.spec => spec/backend.spec | 16 ++++++++-------- backend.spec => spec/backend_cuda.spec | 16 ++++++++-------- src-python/config.py | 2 +- src-tauri/tauri.conf.json | 2 +- utils/clean.py | 8 ++++++++ task_kill.py => utils/task_kill.py | 0 update_version.py => utils/update_version.py | 10 +++++----- zip.py => utils/zip.py | 0 15 files changed, 43 insertions(+), 41 deletions(-) create mode 100644 bat/build.bat create mode 100644 bat/build_cuda.bat rename install.bat => bat/install.bat (100%) delete mode 100644 build.bat delete mode 100644 build_cuda.bat delete mode 100644 clean.py rename backend_cuda.spec => spec/backend.spec (62%) rename backend.spec => spec/backend_cuda.spec (61%) create mode 100644 utils/clean.py rename task_kill.py => utils/task_kill.py (100%) rename update_version.py => utils/update_version.py (76%) rename zip.py => utils/zip.py (100%) diff --git a/bat/build.bat b/bat/build.bat new file mode 100644 index 00000000..7760b7ee --- /dev/null +++ b/bat/build.bat @@ -0,0 +1,2 @@ +call .venv/Scripts/activate +pyinstaller spec/backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/bat/build_cuda.bat b/bat/build_cuda.bat new file mode 100644 index 00000000..0c86f70d --- /dev/null +++ b/bat/build_cuda.bat @@ -0,0 +1,2 @@ +call .venv_cuda/Scripts/activate +pyinstaller spec/backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/install.bat b/bat/install.bat similarity index 100% rename from install.bat rename to bat/install.bat diff --git a/build.bat b/build.bat deleted file mode 100644 index 3c08629c..00000000 --- a/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .venv/Scripts/activate -pyinstaller backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/build_cuda.bat b/build_cuda.bat deleted file mode 100644 index 308b9174..00000000 --- a/build_cuda.bat +++ /dev/null @@ -1,2 +0,0 @@ -call .venv_cuda/Scripts/activate -pyinstaller backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR \ No newline at end of file diff --git a/clean.py b/clean.py deleted file mode 100644 index 93084e62..00000000 --- a/clean.py +++ /dev/null @@ -1,6 +0,0 @@ -import shutil - -shutil.rmtree('build', ignore_errors=True) -shutil.rmtree('dist', ignore_errors=True) -shutil.rmtree('src-tauri\\bin', ignore_errors=True) -shutil.rmtree('src-tauri\\target', ignore_errors=True) \ No newline at end of file diff --git a/package.json b/package.json index 1c66c4f5..69bb278d 100644 --- a/package.json +++ b/package.json @@ -4,24 +4,24 @@ "version": "3.3.2", "type": "module", "scripts": { - "setup-python": "install.bat", - "build-python": "build.bat", - "build-python-cuda": "build_cuda.bat", + "setup-python": "bat\\install.bat", + "build-python": "bat\\build.bat", + "build-python-cuda": "bat\\build_cuda.bat", "vite": "vite", "vite-build": "vite build", "vite-preview": "vite preview", "tauri": "tauri", "tauri-dev": "tauri dev", - "task-kill": "python task_kill.py", - "clean": "python clean.py", - "update-version": "python update_version.py", + "task-kill": "python utils\\task_kill.py", + "clean": "python utils\\clean.py", + "update-version": "python utils\\update_version.py", "dev": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run dev-ui", "dev-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run dev-ui", "dev-ui": "npm run task-kill && npm-run-all --parallel vite tauri-dev", "build": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run vite-build && npm run tauri build", "build-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run vite-build && npm run tauri build", - "release": "npm run update-version && npm run build && python zip.py --zip_name VRCT.zip", - "release-cuda": "npm run update-version && npm run build-cuda && python zip.py --zip_name VRCT_cuda.zip", + "release": "npm run update-version && npm run build && python utils\\zip.py --zip_name VRCT.zip", + "release-cuda": "npm run update-version && npm run build-cuda && python utils\\zip.py --zip_name VRCT_cuda.zip", "release-all": "npm run update-version && npm run release && npm run release-cuda" }, "dependencies": { diff --git a/backend_cuda.spec b/spec/backend.spec similarity index 62% rename from backend_cuda.spec rename to spec/backend.spec index 8d80b6ec..57d72f6f 100644 --- a/backend_cuda.spec +++ b/spec/backend.spec @@ -2,17 +2,17 @@ a = Analysis( - ['src-python\\mainloop.py'], + ['..\\src-python\\mainloop.py'], pathex=[], binaries=[], datas=[ - ('./src-python/models/overlay/fonts', 'fonts/'), - ('./src-python/models/translation/prompt', 'prompt/'), - ('./src-python/models/translation/languages', 'languages/'), - ('.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'), - ('.venv_cuda/Lib/site-packages/openvr', 'openvr/'), - ('.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/'), - ('.venv/Lib/site-packages/hf_xet', 'hf_xet/') + ('./../src-python/models/overlay/fonts', 'fonts/'), + ('./../src-python/models/translation/prompt', 'prompt/'), + ('./../src-python/models/translation/languages', 'languages/'), + ('./../.venv/Lib/site-packages/zeroconf', 'zeroconf/'), + ('./../.venv/Lib/site-packages/openvr', 'openvr/'), + ('./../.venv/Lib/site-packages/faster_whisper', 'faster_whisper/'), + ('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/') ], hiddenimports=[], hookspath=[], diff --git a/backend.spec b/spec/backend_cuda.spec similarity index 61% rename from backend.spec rename to spec/backend_cuda.spec index 605c82fb..3d665926 100644 --- a/backend.spec +++ b/spec/backend_cuda.spec @@ -2,17 +2,17 @@ a = Analysis( - ['src-python\\mainloop.py'], + ['..\\src-python\\mainloop.py'], pathex=[], binaries=[], datas=[ - ('./src-python/models/overlay/fonts', 'fonts/'), - ('./src-python/models/translation/prompt', 'prompt/'), - ('./src-python/models/translation/languages', 'languages/'), - ('.venv/Lib/site-packages/zeroconf', 'zeroconf/'), - ('.venv/Lib/site-packages/openvr', 'openvr/'), - ('.venv/Lib/site-packages/faster_whisper', 'faster_whisper/'), - ('.venv/Lib/site-packages/hf_xet', 'hf_xet/') + ('./../src-python/models/overlay/fonts', 'fonts/'), + ('./../src-python/models/translation/prompt', 'prompt/'), + ('./../src-python/models/translation/languages', 'languages/'), + ('./../.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'), + ('./../.venv_cuda/Lib/site-packages/openvr', 'openvr/'), + ('./../.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/'), + ('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/') ], hiddenimports=[], hookspath=[], diff --git a/src-python/config.py b/src-python/config.py index cc53ab16..1b47d961 100644 --- a/src-python/config.py +++ b/src-python/config.py @@ -736,7 +736,7 @@ class Config: def init_config(self): # Read Only - self._VERSION = "0.0.0" + self._VERSION = "3.3.2" if getattr(sys, 'frozen', False): self._PATH_LOCAL = os_path.dirname(sys.executable) else: diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0bbba778..d7695cf9 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "VRCT", - "version": "0.0.0", + "version": "3.3.2", "identifier": "com.vrct.app", "build": { "beforeDevCommand": "", diff --git a/utils/clean.py b/utils/clean.py new file mode 100644 index 00000000..c97ffd0c --- /dev/null +++ b/utils/clean.py @@ -0,0 +1,8 @@ +import os +import shutil + +root = os.path.dirname(os.path.dirname(__file__)) +shutil.rmtree(os.path.join(root, 'build'), ignore_errors=True) +shutil.rmtree(os.path.join(root, 'dist'), ignore_errors=True) +shutil.rmtree(os.path.join(root, 'src-tauri', 'bin'), ignore_errors=True) +shutil.rmtree(os.path.join(root, 'src-tauri', 'target'), ignore_errors=True) \ No newline at end of file diff --git a/task_kill.py b/utils/task_kill.py similarity index 100% rename from task_kill.py rename to utils/task_kill.py diff --git a/update_version.py b/utils/update_version.py similarity index 76% rename from update_version.py rename to utils/update_version.py index 38b11a1a..fac75c76 100644 --- a/update_version.py +++ b/utils/update_version.py @@ -1,16 +1,16 @@ +import os import json -from pathlib import Path def update_versions(): - root = Path(__file__).parent + root = os.path.join(os.path.dirname(os.path.dirname(__file__))) # package.jsonからバージョンを読み取る - with open(root / "package.json", "r", encoding="utf-8") as f: + with open(os.path.join(root, "package.json"), "r", encoding="utf-8") as f: package_json = json.load(f) version = package_json["version"] # tauri.conf.jsonを更新 - tauri_conf_path = root / "src-tauri" / "tauri.conf.json" + tauri_conf_path = os.path.join(root, "src-tauri", "tauri.conf.json") with open(tauri_conf_path, "r", encoding="utf-8") as f: tauri_conf = json.load(f) @@ -20,7 +20,7 @@ def update_versions(): json.dump(tauri_conf, f, indent=4, ensure_ascii=False) # config.pyを更新 - config_path = root / "src-python" / "config.py" + config_path = os.path.join(root, "src-python", "config.py") with open(config_path, "r", encoding="utf-8") as f: content = f.read() diff --git a/zip.py b/utils/zip.py similarity index 100% rename from zip.py rename to utils/zip.py From 7f7413e050b5c2bd320dbc5e4f4befb28d628778 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:22:22 +0900 Subject: [PATCH 3/4] [Update] utils: Change version update message to English --- utils/update_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/update_version.py b/utils/update_version.py index fac75c76..6aad694f 100644 --- a/utils/update_version.py +++ b/utils/update_version.py @@ -33,7 +33,7 @@ def update_versions(): with open(config_path, "w", encoding="utf-8") as f: f.write(new_content) - print(f"✓ バージョン {version} に更新しました") + print(f"updated to version {version}") if __name__ == "__main__": update_versions() \ No newline at end of file From 3ce8590ce28a060a7debd6a063c8a2f1b8377185 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Tue, 25 Nov 2025 21:46:48 +0900 Subject: [PATCH 4/4] =?UTF-8?q?build=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/readme_build.md | 422 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 422 insertions(+) create mode 100644 docs/readme_build.md diff --git a/docs/readme_build.md b/docs/readme_build.md new file mode 100644 index 00000000..644c7b4c --- /dev/null +++ b/docs/readme_build.md @@ -0,0 +1,422 @@ +# VRCTビルドガイド + +このドキュメントでは、VRCTプロジェクトのビルド方法について説明します。 + +## 目次 + +- [必要な環境](#必要な環境) +- [初回セットアップ](#初回セットアップ) +- [ビルドの種類](#ビルドの種類) +- [開発ビルド](#開発ビルド) +- [リリースビルド](#リリースビルド) +- [ビルドプロセスの詳細](#ビルドプロセスの詳細) +- [トラブルシューティング](#トラブルシューティング) + +## 必要な環境 + +### 必須ソフトウェア + +- **Node.js** (npm含む) +- **Python 3.x** +- **Rust** (Tauri用) +- **Git** + +### 推奨環境 + +- Windows 10/11 +- メモリ: 8GB以上 +- ストレージ: 5GB以上の空き容量 + +## 初回セットアップ + +### 1. リポジトリのクローン + +```bash +git clone +cd VRCT +``` + +### 2. Node.js依存関係のインストール + +```bash +npm install +``` + +### 3. Python環境のセットアップ + +以下のコマンドで、CPU版とCUDA版の両方の仮想環境を作成します: + +```bash +npm run setup-python +``` + +このコマンドは以下の処理を実行します: +- `.venv` (CPU版) の作成と依存関係のインストール +- `.venv_cuda` (CUDA版) の作成と依存関係のインストール + +> **注意**: CUDA版を使用する場合は、NVIDIAのGPUとCUDA Toolkit 12.8が必要です。 + +## ビルドの種類 + +VRCTでは、以下の2種類のビルドが可能です: + +### CPU版 +標準的なCPUで動作するバージョン。GPUは不要。 + +### CUDA版 +NVIDIA GPUを活用した高速処理版。CUDA対応GPUが必要。 + +## 開発ビルド + +開発中にアプリケーションを実行・テストするためのビルドです。 + +### CPU版の開発ビルド + +```bash +npm run dev +``` + +このコマンドは以下を実行します: +1. 実行中のプロセスを終了 (`task-kill`) +2. ビルドファイルのクリーンアップ (`clean`) +3. バージョン情報の更新 (`update-version`) +4. Pythonバックエンドのビルド (`build-python`) +5. ViteとTauriの開発サーバー起動 + +### CUDA版の開発ビルド + +```bash +npm run dev-cuda +``` + +CPU版と同様ですが、CUDA対応のPythonバックエンドをビルドします。 + +### UIのみの開発 + +バックエンドのビルドをスキップして、UIのみを開発する場合: + +```bash +npm run dev-ui +``` + +## リリースビルド + +配布用のインストーラーを作成するビルドです。 + +### CPU版のリリースビルド + +```bash +npm run build +``` + +または、ZIP形式でパッケージング: + +```bash +npm run release +``` + +生成されるファイル: +- インストーラー: `src-tauri/target/release/bundle/nsis/` +- ZIPファイル: `VRCT.zip` (releaseコマンド使用時) + +### CUDA版のリリースビルド + +```bash +npm run build-cuda +``` + +または、ZIP形式でパッケージング: + +```bash +npm run release-cuda +``` + +生成されるファイル: +- インストーラー: `src-tauri/target/release/bundle/nsis/` +- ZIPファイル: `VRCT_cuda.zip` (release-cudaコマンド使用時) + +### 両バージョンの同時ビルド + +CPU版とCUDA版の両方をビルドする場合: + +```bash +npm run release-all +``` + +## ビルドプロセスの詳細 + +### バージョン管理 + +バージョンは `package.json` で一元管理され、以下のファイルに自動で同期されます: + +```bash +npm run update-version +``` + +更新されるファイル: +- `src-tauri/tauri.conf.json` +- `src-python/config.py` + +### どこにバージョンを設定すればReleaseに反映されるか + +- **設定箇所**: `package.json` の `version` が唯一のソース・オブ・トゥルース。 +- **反映方法**: `npm run update-version`(`build`/`build-cuda`/`release`コマンド内でも自動実行)により、 + - `src-tauri/tauri.conf.json` の `version` に同期(Tauri/NSISインストーラーの表示・メタデータに使用) + - `src-python/config.py` の `self._VERSION` に同期(ランタイム表示等に使用) +- **成果物への影響**: + - インストーラー(NSIS)は `tauri.conf.json` の `version` を取り込み、プロダクトバージョンとして反映。 + - ZIPパッケージ名はスクリプト既定では固定(`VRCT.zip`/`VRCT_cuda.zip`)。ファイル名にバージョンを含めたい場合は、`package.json` の `release` スクリプトを調整してください。 + +### Pythonバックエンドのビルド + +#### CPU版 + +```bash +npm run build-python +``` + +実行内容: + +- `.venv` 環境をアクティベート +- PyInstallerで `spec/backend.spec` を使用してビルド +- 出力先: `src-tauri/bin/` + +#### CUDA版 + +```bash +npm run build-python-cuda +``` + +実行内容: + +- `.venv_cuda` 環境をアクティベート +- PyInstallerで `spec/backend_cuda.spec` を使用してビルド +- 出力先: `src-tauri/bin/` + +### フロントエンドのビルド + +```bash +npm run vite-build +``` + +Viteを使用してフロントエンド(React)をビルドし、`dist/` ディレクトリに出力します。 + +### Tauriアプリケーションのビルド + +```bash +npm run tauri build +``` + +Tauriを使用して最終的なデスクトップアプリケーションをビルドします。 + +## GitHub ActionsでのRelease自動化 + +Windows用のReleaseをGitHub Actionsで自動生成・公開する例です。`package.json` のバージョンをタグ・リリース名に使い、TauriのNSISインストーラーとZIPを添付します。 + +### 推奨トリガー + +- タグプッシュ(例: `v*`)または手動実行(`workflow_dispatch`) + +### サンプルワークフロー(Windows) + +```yaml +name: Release (Windows) + +on: + workflow_dispatch: {} + push: + tags: + - 'v*' + +jobs: + build-release-windows: + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install dependencies + run: | + npm ci + + - name: Setup Python envs (.venv/.venv_cuda) + run: | + npm run setup-python + + - name: Sync versions from package.json + run: | + npm run update-version + + - name: Build (CPU) + run: | + npm run build + + - name: Package ZIP (CPU) + run: | + python utils/zip.py --zip_name VRCT.zip + + - name: Read version from package.json + id: pkg + shell: pwsh + run: | + $version = (Get-Content package.json | ConvertFrom-Json).version + echo "version=$version" >> $env:GITHUB_OUTPUT + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: VRCT-windows-${{ steps.pkg.outputs.version }} + path: | + src-tauri/target/release/bundle/nsis/**/* + VRCT.zip + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.pkg.outputs.version }} + name: VRCT v${{ steps.pkg.outputs.version }} + files: | + src-tauri/target/release/bundle/nsis/**/* + VRCT.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +``` + +### ポイント +- ビルド前に必ず `npm run update-version` を実行して、`tauri.conf.json` と `config.py` にバージョンを同期します。 +- アーティファクトのパスは既定構成に合わせています: + - インストーラー: `src-tauri/target/release/bundle/nsis/` + - ZIP: ルート直下の `VRCT.zip` +- CUDA版も同様にビルドする場合は、`npm run build-cuda` と `python utils/zip.py --zip_name VRCT_cuda.zip` を追加して、別アーティファクト名でアップロード・添付してください。 + +## ユーティリティコマンド + +### クリーンアップ + +```bash +npm run clean +``` + +以下のディレクトリを削除します: +- `build/` +- `dist/` +- `src-tauri/bin/` +- `src-tauri/target/` + +### プロセスの強制終了 + +```bash +npm run task-kill +``` + +VRCTに関連する実行中のプロセスを終了します。 + +## ディレクトリ構成 + +``` +VRCT/ +├── bat/ # バッチスクリプト +│ ├── build.bat # CPU版Pythonビルド +│ ├── build_cuda.bat # CUDA版Pythonビルド +│ └── install.bat # Python環境セットアップ +├── spec/ # PyInstallerスペックファイル +│ ├── backend.spec # CPU版ビルド設定 +│ └── backend_cuda.spec # CUDA版ビルド設定 +├── src-python/ # Pythonバックエンドソースコード +├── src-tauri/ # Tauriアプリケーション設定 +│ ├── bin/ # ビルド済みPythonバイナリ(生成) +│ └── target/ # Tauriビルド出力(生成) +├── src-ui/ # Reactフロントエンドソースコード +├── utils/ # ユーティリティスクリプト +│ ├── clean.py # クリーンアップスクリプト +│ ├── task_kill.py # プロセス終了スクリプト +│ ├── update_version.py # バージョン更新スクリプト +│ └── zip.py # ZIPパッケージング +├── package.json # Node.js設定とバージョン管理 +├── requirements.txt # Python依存関係(CPU版) +└── requirements_cuda.txt # Python依存関係(CUDA版) +``` + +## トラブルシューティング + +### Python環境のエラー + +仮想環境を再作成してください: + +```bash +npm run setup-python +``` + +### ビルドが失敗する + +1. クリーンアップを実行: +```bash +npm run clean +``` + +2. Node.js依存関係を再インストール: +```bash +npm install +``` + +3. 再度ビルド: +```bash +npm run build +``` + +### CUDA版が動作しない + +- CUDA Toolkit 12.8がインストールされているか確認 +- NVIDIA GPUドライバーが最新か確認 +- `requirements_cuda.txt` の依存関係が正しくインストールされているか確認 + +### プロセスが残っている + +```bash +npm run task-kill +``` + +を実行して、すべてのVRCTプロセスを終了してください。 + +## 参考情報 + +### PyInstallerスペックファイル + +- `spec/backend.spec` - CPU版の設定 +- `spec/backend_cuda.spec` - CUDA版の設定 + +これらのファイルでは、以下を設定しています: +- エントリーポイント: `src-python/mainloop.py` +- データファイル(フォント、プロンプト、言語ファイル等)のパス +- 依存ライブラリのパス + +### バージョン管理フロー + +1. `package.json` のバージョンを更新 +2. `npm run update-version` を実行 +3. 自動的に `tauri.conf.json` と `config.py` が更新される + +### リリースパッケージの内容 + +ZIPファイルには以下が含まれます: +- `VRCT.exe` - メインアプリケーション +- `VRCT-sidecar.exe` - Pythonバックエンド +- `_internal/` - 必要な依存ファイル + +## ライセンス + +プロジェクトのライセンスについては、`LICENSE` ファイルを参照してください。