-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync and Release automation #13694
Sync and Release automation #13694
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use std::fmt::Write; | ||
use std::path::Path; | ||
|
||
use crate::utils::{UpdateMode, clippy_version, replace_region_in_file}; | ||
|
||
const CARGO_TOML_FILES: [&str; 4] = [ | ||
"clippy_config/Cargo.toml", | ||
"clippy_lints/Cargo.toml", | ||
"clippy_utils/Cargo.toml", | ||
"Cargo.toml", | ||
]; | ||
|
||
pub fn bump_version() { | ||
let (minor, mut patch) = clippy_version(); | ||
patch += 1; | ||
for file in &CARGO_TOML_FILES { | ||
replace_region_in_file( | ||
UpdateMode::Change, | ||
Path::new(file), | ||
"# begin autogenerated version\n", | ||
"# end autogenerated version", | ||
|res| { | ||
writeln!(res, "version = \"0.{minor}.{patch}\"").unwrap(); | ||
}, | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use std::fmt::Write; | ||
use std::path::Path; | ||
|
||
use chrono::offset::Utc; | ||
|
||
use crate::utils::{UpdateMode, replace_region_in_file}; | ||
|
||
pub fn update_nightly() { | ||
// Update rust-toolchain nightly version | ||
let date = Utc::now().format("%Y-%m-%d").to_string(); | ||
replace_region_in_file( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to modify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh good catch. That must've been lost during a rebase. Added those in the second commit. Nothing else changed in the force push. |
||
UpdateMode::Change, | ||
Path::new("rust-toolchain"), | ||
"# begin autogenerated nightly\n", | ||
"# end autogenerated nightly", | ||
|res| { | ||
writeln!(res, "channel = \"nightly-{date}\"").unwrap(); | ||
}, | ||
); | ||
|
||
// Update clippy_utils nightly version | ||
replace_region_in_file( | ||
UpdateMode::Change, | ||
Path::new("clippy_utils/README.md"), | ||
"<!-- begin autogenerated nightly -->\n", | ||
"<!-- end autogenerated nightly -->", | ||
|res| { | ||
writeln!(res, "```").unwrap(); | ||
writeln!(res, "nightly-{date}").unwrap(); | ||
writeln!(res, "```").unwrap(); | ||
}, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for these two to be subcommands in their own structs? Is there a plan to add new commands to them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see #12759