[Update] バージョン管理: package.json, tauri.conf.json, config.pyのバージョンを更新し、update_version.pyを追加
This commit is contained in:
19
package.json
19
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",
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,7 +11,8 @@
|
||||
},
|
||||
"app": {
|
||||
"enableGTKAppId": false,
|
||||
"windows": [{
|
||||
"windows": [
|
||||
{
|
||||
"title": "VRCT",
|
||||
"center": true,
|
||||
"width": 450,
|
||||
@@ -21,10 +22,14 @@
|
||||
"transparent": true,
|
||||
"decorations": false,
|
||||
"shadow": false
|
||||
}],
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null,
|
||||
"capabilities": ["default", "vrct-capability"]
|
||||
"capabilities": [
|
||||
"default",
|
||||
"vrct-capability"
|
||||
]
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
|
||||
39
update_version.py
Normal file
39
update_version.py
Normal file
@@ -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()
|
||||
Reference in New Issue
Block a user