Skip to content

Commit

Permalink
feat: expose labels to GHA matrix output
Browse files Browse the repository at this point in the history
  • Loading branch information
lleyton committed Jun 24, 2024
1 parent e7ce7cc commit 78c9b63
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum ConsoleOut {
pub struct BuildEntry {
pub pkg: String,
pub arch: String,
pub labels: BTreeMap<String, String>,
}

pub fn fetch_build_entries(config: Manifest) -> Vec<BuildEntry> {
Expand All @@ -46,13 +47,21 @@ pub fn fetch_build_entries(config: Manifest) -> Vec<BuildEntry> {
if let Some(rpm) = project.rpm {
if rpm.enable_scm.unwrap_or(false) {
for arch in &*DEFAULT_ARCHES {
entries.push(BuildEntry { pkg: std::mem::take(&mut name), arch: arch.clone() });
entries.push(BuildEntry {
pkg: std::mem::take(&mut name),
arch: arch.clone(),
labels: project.labels.clone(),
});
}
continue;
}
}
for arch in project.arches.unwrap_or_else(|| DEFAULT_ARCHES.to_vec()) {
entries.push(BuildEntry { pkg: name.clone(), arch: arch.clone() });
entries.push(BuildEntry {
pkg: name.clone(),
arch: arch.clone(),
labels: project.labels.clone(),
});
}
}

Expand Down

0 comments on commit 78c9b63

Please sign in to comment.