build(workflow): 更新 GitHub Actions 工作流配置 #94

This commit is contained in:
LOG1997
2025-12-09 21:16:59 +08:00
parent fdd0aeef1c
commit 8e2e131625
7 changed files with 169 additions and 42 deletions

22
build/syncVersion.js Normal file
View File

@@ -0,0 +1,22 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// 读取 package.json 版本号
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
const version = packageJson.version;
// 读取并更新 tauri.conf.json
const tauriConfPath = path.join(__dirname, '..', 'src-tauri', 'tauri.conf.json');
const tauriConf = JSON.parse(fs.readFileSync(tauriConfPath, 'utf8'));
// 更新版本号
tauriConf.version = version;
// 写回 tauri.conf.json
fs.writeFileSync(tauriConfPath, JSON.stringify(tauriConf, null, 2));
console.log(`Tauri 配置版本号已同步至: ${version}`);