Skip to content

Commit

Permalink
fix: cargo-rust-registry requires the package name
Browse files Browse the repository at this point in the history
  • Loading branch information
loispostula committed Jul 22, 2024
1 parent ca82f5e commit eafc139
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-fslabscli"
version = "2.0.0"
version = "2.0.1"
edition = "2021"
authors = ["FSLABS DevOps Gods"]
repository = "https://github.com/ForesightMiningSoftwareCorporation/fslabsci"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/generate_workflow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct Options {
template: Option<PathBuf>,
#[arg(long, default_value_t = false)]
no_depends_on_template_jobs: bool,
#[arg(long, default_value = "v3.0.0")]
#[arg(long, default_value = "v3.0.1")]
build_workflow_version: String,
#[arg(long)]
fslabscli_version: Option<String>,
Expand Down Expand Up @@ -718,6 +718,7 @@ pub async fn generate_workflow(
}
if member.publish_detail.cargo.publish {
member_workflows.push(Box::new(PublishRustRegistryWorkflow::new(
member_key.clone(),
working_directory.clone(),
&dynamic_value_base,
)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub struct PublishRustRegistryWorkflowOutputs {

#[derive(Default, Clone)]
pub struct PublishRustRegistryWorkflowInputs {
/// Package name
pub package: String,
/// Working directory to run the cargo command
pub working_directory: String,
/// Which toolchain to use
Expand All @@ -29,6 +31,7 @@ pub struct PublishRustRegistryWorkflowInputs {
impl From<&PublishRustRegistryWorkflowInputs> for IndexMap<String, Value> {
fn from(val: &PublishRustRegistryWorkflowInputs) -> Self {
let mut map: IndexMap<String, Value> = IndexMap::new();
map.insert("package".to_string(), val.package.clone().into());
map.insert(
"working_directory".to_string(),
val.working_directory.clone().into(),
Expand Down Expand Up @@ -61,9 +64,10 @@ pub struct PublishRustRegistryWorkflow {
}

impl PublishRustRegistryWorkflow {
pub fn new(working_directory: String, dynamic_value_base: &str) -> Self {
pub fn new(package: String, working_directory: String, dynamic_value_base: &str) -> Self {
Self {
inputs: PublishRustRegistryWorkflowInputs {
package,
working_directory,
toolchain: format!("${{{{ {}.{}) }}}}", dynamic_value_base, "toolchain"),
additional_args: format!(
Expand Down

0 comments on commit eafc139

Please sign in to comment.