workflow_core/version.rs
1/// UTC timestamp of when the crate was built.
2pub const BUILD_TIMESTAMP: &str = env!("VERGEN_BUILD_TIMESTAMP");
3/// Output of `git describe` for the build's source revision.
4pub const GIT_DESCRIBE: &str = env!("VERGEN_GIT_DESCRIBE");
5/// Git commit SHA of the build's source revision.
6pub const GIT_SHA: &str = env!("VERGEN_GIT_SHA");
7/// Release channel of the `rustc` used to build the crate (e.g. `stable`).
8pub const RUSTC_CHANNEL: &str = env!("VERGEN_RUSTC_CHANNEL");
9/// Commit date of the `rustc` used to build the crate.
10pub const RUSTC_COMMIT_DATE: &str = env!("VERGEN_RUSTC_COMMIT_DATE");
11/// Commit hash of the `rustc` used to build the crate.
12pub const RUSTC_COMMIT_HASH: &str = env!("VERGEN_RUSTC_COMMIT_HASH");
13/// Host target triple of the `rustc` used to build the crate.
14pub const RUSTC_HOST_TRIPLE: &str = env!("VERGEN_RUSTC_HOST_TRIPLE");
15/// LLVM version backing the `rustc` used to build the crate.
16pub const RUSTC_LLVM_VERSION: &str = env!("VERGEN_RUSTC_LLVM_VERSION");
17/// Semantic version of the `rustc` used to build the crate.
18pub const RUSTC_SEMVER: &str = env!("VERGEN_RUSTC_SEMVER");
19
20/// Returns the crate version combined with the git describe string
21/// (e.g. `1.2.3-v1.2.3-4-gabcdef`).
22pub fn version() -> String {
23 format!("{}-{GIT_DESCRIBE}", env!("CARGO_PKG_VERSION"))
24}
25
26/// Returns the crate's semantic version as declared in `Cargo.toml`.
27pub fn semver() -> &'static str {
28 env!("CARGO_PKG_VERSION")
29}