CI / lint (push) Failing after 11s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 15s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
- build.rs: lit git rev-parse --short HEAD, passe GIT_HASH au compilateur - main.rs: ABOUT_MSG constant au compile-time avec CARGO_PKG_VERSION + GIT_HASH - get_version() command Tauri retourne v2.0.0-abc1234 - Log + À propos (menu natif + tray) utilisent la version dynamique - rerun-if-changed sur .git/HEAD pour recompiler à chaque commit
17 lines
534 B
Rust
17 lines
534 B
Rust
fn main() {
|
|
// Inject Git commit hash as version suffix
|
|
let git_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());
|
|
|
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
|
println!("cargo:rerun-if-changed=.git/HEAD");
|
|
println!("cargo:rerun-if-changed=.git/refs/heads/main");
|
|
|
|
tauri_build::build()
|
|
}
|