-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync and Release automation (#13694)
Based on #13693 Adds 2 subcommands to `cargo dev`: - `cargo dev sync update_nightly`: Which updates the nightly versions in `rust-toolchain` and `clippy_utils/README.md` - `cargo dev release bump_version`: Bumps the version in all relevant `Cargo.toml` files Those are pulled out of #12759, which I'll rebase on this. Next step is to update the documentation, which I'll partly pull out of #12762 r? @blyxyas (as you reviewed the first PR in the chain and were assigned to the second one) cc #13556 changelog: none
- Loading branch information
Showing
16 changed files
with
263 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( | ||
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(); | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.