Skip to content

Commit

Permalink
Filter version and pre-release tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jiivan committed Mar 10, 2021
1 parent a5f89d1 commit b754bcf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions utils/compile-time-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ use git_version::git_version;
use metrics::gauge;
use semver::Version;

/// Returns latest tag (via `git describe --tag --abbrev=0`).
/// Returns latest version tag.
pub fn git_tag() -> &'static str {
git_version!(args = ["--tag", "--abbrev=0"], cargo_prefix = "")
git_version!(
args = [
"--tag",
"--abbrev=0",
"--match=v[0-9]*",
"--match=pre-rel-[0-9]*"
],
cargo_prefix = ""
)
}

/// Returns latest commit short hash.
Expand Down

0 comments on commit b754bcf

Please sign in to comment.