tftsr-devops_investigation/src-tauri/build.rs
Shaun Arman ae3e478034
All checks were successful
Auto Tag / autotag (push) Successful in 6s
Auto Tag / wiki-sync (push) Successful in 6s
Auto Tag / changelog (push) Successful in 42s
Auto Tag / build-macos-arm64 (push) Successful in 2m53s
Auto Tag / build-linux-amd64 (push) Successful in 12m6s
Auto Tag / build-linux-arm64 (push) Successful in 14m10s
Auto Tag / build-windows-amd64 (push) Successful in 14m45s
feat: implement dynamic versioning from Git tags
- Add build.rs to read version from git describe --tags
- Create update-version.mjs script to sync version across files
- Add get_app_version() command to Rust backend
- Update App.tsx to use custom version command
- Run version update in CI before Rust checks
2026-04-13 16:08:58 -05:00

31 lines
779 B
Rust

fn main() {
let version = get_version_from_git();
println!("cargo:rustc-env=APP_VERSION={}", version);
println!("cargo:rerun-if-changed=.git/refs/heads/master");
println!("cargo:rerun-if-changed=.git/refs/tags");
tauri_build::build()
}
fn get_version_from_git() -> String {
if let Ok(output) = std::process::Command::new("git")
.arg("describe")
.arg("--tags")
.arg("--abbrev=0")
.output()
{
if output.status.success() {
let version = String::from_utf8_lossy(&output.stdout)
.trim()
.trim_start_matches('v')
.to_string();
if !version.is_empty() {
return version;
}
}
}
"0.2.50".to_string()
}