From 0678752be0d57643202dcdddcd869d47acd4a3ad Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 1 Oct 2022 21:58:57 +0100 Subject: [PATCH] Finish off the last bit --- tools/src/release.rs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tools/src/release.rs b/tools/src/release.rs index 67b672d3..34e1225d 100644 --- a/tools/src/release.rs +++ b/tools/src/release.rs @@ -58,6 +58,26 @@ pub fn release(matches: &clap::ArgMatches) -> Result<(), Error> { .spawn() .map_err(|_| Error::JustCiFailed)?; + if !dry_run { + execute_git_command( + &root_directory, + &["commit", "-am", &format!("Release v{version}")], + )?; + execute_git_command( + &root_directory, + &[ + "tag", + "-a", + &version.to_string(), + "-m", + &format!("v{version}"), + ], + )?; + } + + println!("Done! Push with"); + println!("git push --atomic origin master v{version}"); + Ok(()) } @@ -95,12 +115,6 @@ fn update_to_version( .parse::() .map_err(|_| Error::InvalidToml(cargo_toml_file.to_string_lossy().into_owned()))?; - println!( - "{}: {} {:?}", - cargo_toml_file.to_string_lossy(), - project_name, - cargo_toml["dependencies"].get(&project_name) - ); if let Some(this_dep) = cargo_toml["dependencies"].get_mut(&project_name) { match this_dep { toml_edit::Item::Value(s @ toml_edit::Value::String(_)) => {