build: only sign if a gpg key able to sign is present
Some checks failed
CI / build (push) Failing after 1m50s

This commit is contained in:
2026-01-06 18:07:34 +01:00
parent b3365afe5b
commit 1c9f6cccd2
6 changed files with 107 additions and 2 deletions

View File

@@ -114,7 +114,8 @@ fn increment_suffix(version: &str, suffix: &str) -> String {
}
}
/// Parse a changelog file first entry header, to obtain (package, version, series)
/// Parse a changelog file first entry header
/// Returns (package, version, series) tuple from the last modification entry
pub fn parse_changelog_header(
path: &Path,
) -> Result<(String, String, String), Box<dyn std::error::Error>> {
@@ -135,6 +136,33 @@ pub fn parse_changelog_header(
}
}
/// Parse a changelog file footer to extract maintainer information
/// Returns (name, email) tuple from the last modification entry
pub fn parse_changelog_footer(path: &Path) -> Result<(String, String), Box<dyn std::error::Error>> {
let mut file = File::open(path)?;
let mut content = String::new();
file.read_to_string(&mut content)?;
// Find the last maintainer line (format: -- Name <email> Date)
let re = Regex::new(r"--\s*([^<]+?)\s*<([^>]+)>\s*")?;
if let Some(last_match) = re.captures_iter(&content).last() {
let name = last_match
.get(1)
.map_or("", |m| m.as_str())
.trim()
.to_string();
let email = last_match
.get(2)
.map_or("", |m| m.as_str())
.trim()
.to_string();
Ok((name, email))
} else {
Err(format!("No maintainer information found in {}", path.display()).into())
}
}
/*
* Obtain all commit messages as a list since a tagged version in a git repository
*/