feat: Started on updates and workflows

This commit is contained in:
Tickbase
2025-05-18 21:05:32 +02:00
parent 2376690230
commit e633524465
18 changed files with 7471 additions and 454 deletions

29
scripts/sync-version.js Normal file
View File

@@ -0,0 +1,29 @@
const fs = require('fs')
const path = require('path')
// Read current version from package.json
const packageJsonPath = path.join(__dirname, '..', 'package.json')
const packageJson = require(packageJsonPath)
const version = packageJson.version
console.log(`Current version: ${version}`)
// Update Cargo.toml
const cargoTomlPath = path.join(__dirname, '..', 'src-tauri', 'Cargo.toml')
let cargoToml = fs.readFileSync(cargoTomlPath, 'utf8')
// Replace the version in Cargo.toml
cargoToml = cargoToml.replace(/version\s*=\s*"[^"]+"/m, `version = "${version}"`)
fs.writeFileSync(cargoTomlPath, cargoToml)
console.log(`Updated Cargo.toml version to ${version}`)
// Update tauri.conf.json
const tauriConfigPath = path.join(__dirname, '..', 'src-tauri', 'tauri.conf.json')
const tauriConfig = JSON.parse(fs.readFileSync(tauriConfigPath, 'utf8'))
// Set the version in tauri.conf.json
tauriConfig.version = version
fs.writeFileSync(tauriConfigPath, JSON.stringify(tauriConfig, null, 2))
console.log(`Updated tauri.conf.json version to ${version}`)
console.log('Version synchronization completed!')