Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Release test
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Mar 27, 2024
1 parent 081af03 commit 25e90c0
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.filter_map(|s| s.strip_prefix('v'))
.collect::<Vec<_>>();

git(&["status"]);
git(&["rev-parse", "HEAD"]);
git(&["tag", "--list"]);
git(&["show", "v0.9.0"]);
git(&["show", "-s", "v0.9.0"]);
git(&["log", "v0.9.0..HEAD", "--oneline"]);
git(&["describe"]);
git(&["describe", "HEAD"]);
git(&["describe", "master"]);
git(&["describe", "--abbrev=0"]);
git(&["describe", "--abbrev=0", "--candidates=1"]);
git(&[
"tag",
"describe",
"--abbrev=0",
"--candidates=1",
"--match=v*",
]);
git(&["ls-remote", "origin"]);

if tags.len() > 1 {
return Err("More than one version tag found for commit {hash}: {tags:?}".into());
}
Expand Down Expand Up @@ -90,5 +110,21 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo::rustc-env=GIT_COMMIT_TIME={commit_time}");
println!("cargo::rustc-env=GIT_HEAD={hash}");

Ok(())
return Err("aborted".into());

// Ok(())
}

fn git(args: &[&str]) {
let out = Command::new("git").args(args).output().unwrap();

println!("cargo::warning=command: git {:?}", args);

for line in String::from_utf8_lossy(&out.stdout).lines() {
println!("cargo::warning=stdout: {}", line);
}
for line in String::from_utf8_lossy(&out.stderr).lines() {
println!("cargo::warning=stderr: {}", line);
}
println!("cargo::warning=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
}

0 comments on commit 25e90c0

Please sign in to comment.