CI / lint (push) Failing after 9s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 13s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
- backend/version.py: get_version() lit git describe --tags (ex: 1.8.0-301-gabc1234) - main.py: FastAPI version = get_version() dynamique - build.rs: injecte GIT_VERSION, GIT_HASH, SEMVER depuis git describe - main.rs: ABOUT_MSG, get_version(), log utilisent GIT_VERSION - Format: MAJOR.MINOR.PATCH[-commits-gHASH] (ex: 1.8.0, 1.8.0-3-gabc1234) - Fallback: VERSION file ou 0.0.0-dev si Git indisponible
32 lines
1.2 KiB
Rust
32 lines
1.2 KiB
Rust
fn main() {
|
|
// Get version from git describe (same as backend/version.py)
|
|
let version = std::process::Command::new("git")
|
|
.args(["describe", "--tags", "--dirty=-dirty"])
|
|
.output()
|
|
.ok()
|
|
.and_then(|o| String::from_utf8(o.stdout).ok())
|
|
.map(|s| s.trim().trim_start_matches('v').to_string())
|
|
.unwrap_or_else(|| "0.0.0-dev".to_string());
|
|
|
|
// Extract short hash for display
|
|
let short_hash = std::process::Command::new("git")
|
|
.args(["rev-parse", "--short", "HEAD"])
|
|
.output()
|
|
.ok()
|
|
.and_then(|o| String::from_utf8(o.stdout).ok())
|
|
.map(|s| s.trim().to_string())
|
|
.unwrap_or_else(|| "unknown".to_string());
|
|
|
|
// SemVer base (strip -suffix)
|
|
let semver_base = version.split('-').next().unwrap_or("0.0.0");
|
|
|
|
println!("cargo:rustc-env=GIT_VERSION={}", version);
|
|
println!("cargo:rustc-env=GIT_HASH={}", short_hash);
|
|
println!("cargo:rustc-env=SEMVER={}", semver_base);
|
|
println!("cargo:rerun-if-changed=.git/HEAD");
|
|
println!("cargo:rerun-if-changed=.git/refs/heads/main");
|
|
println!("cargo:rerun-if-changed=.git/refs/tags");
|
|
|
|
tauri_build::build()
|
|
}
|