From e4f30e729a5c745eb48f08e98f9b22f10b18a71d Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Tue, 28 Feb 2023 20:45:39 +0400 Subject: [PATCH] Simplify release process by using `cargo-release` --- Cargo.toml | 4 ++++ crates/teloxide-core/Cargo.toml | 8 ++++++++ crates/teloxide-core/src/lib.rs | 2 +- crates/teloxide-macros/Cargo.toml | 8 ++++++-- crates/teloxide/Cargo.toml | 7 +++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 09124e33..d5041ade 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,3 +11,7 @@ edition = "2021" license = "MIT" homepage = "https://github.com/teloxide/teloxide" repository = "https://github.com/teloxide/teloxide" + +[workspace.metadata.release] +tag-message = "Release {{crate_name}} version {{version}}" +tag-name = "{{prefix}}v{{version}}" diff --git a/crates/teloxide-core/Cargo.toml b/crates/teloxide-core/Cargo.toml index 4df1fc7b..7cf15a1d 100644 --- a/crates/teloxide-core/Cargo.toml +++ b/crates/teloxide-core/Cargo.toml @@ -98,6 +98,14 @@ rustdoc-args = ["--cfg", "docsrs", "-Znormalize-docs"] # https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[package.metadata.release] +tag-prefix = "core-" +enable-features = ["full"] +pre-release-replacements = [ + {file="README.md", search="teloxide-core = \"[^\"]+\"", replace="teloxide-core = \"{{version}}\""}, + {file="src/lib.rs", search="teloxide-core = \"[^\"]+\"", replace="teloxide-core = \"{{version}}\""}, + {file="CHANGELOG.md", search="## unreleased", replace="## unreleased\n\n## {{version}} - {{date}}", exactly=1}, +] [[example]] name = "self_info" diff --git a/crates/teloxide-core/src/lib.rs b/crates/teloxide-core/src/lib.rs index bfc94ddf..7cde5201 100644 --- a/crates/teloxide-core/src/lib.rs +++ b/crates/teloxide-core/src/lib.rs @@ -5,7 +5,7 @@ //! asynchronous and built using [`tokio`]. //! //!```toml -//! teloxide_core = "0.9" +//! teloxide-core = "0.9" //! ``` //! _Compiler support: requires rustc 1.64+_. //! diff --git a/crates/teloxide-macros/Cargo.toml b/crates/teloxide-macros/Cargo.toml index e81ffbb1..b536ce16 100644 --- a/crates/teloxide-macros/Cargo.toml +++ b/crates/teloxide-macros/Cargo.toml @@ -13,13 +13,17 @@ documentation = "https://docs.rs/teloxide-core/" # FIXME: add a simple readme for teloxide-macros #readme = "README.md" - [lib] proc-macro = true - [dependencies] quote = "1.0.7" proc-macro2 = "1.0.19" syn = { version = "1.0.13", features = ["full"] } heck = "0.4.0" + +[package.metadata.release] +tag-prefix = "macros-" +pre-release-replacements = [ + {file="CHANGELOG.md", search="## unreleased", replace="## unreleased\n\n## {{version}} - {{date}}", exactly=1}, +] diff --git a/crates/teloxide/Cargo.toml b/crates/teloxide/Cargo.toml index 92703ecd..77971857 100644 --- a/crates/teloxide/Cargo.toml +++ b/crates/teloxide/Cargo.toml @@ -127,6 +127,13 @@ rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "dep_docsrs"] cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[package.metadata.release] +tag-prefix = "" +enable-features = ["full"] +pre-release-replacements = [ + {file="../../README.md", search="teloxide = \\{ version = \"[^\"]+\"", replace="teloxide = { version = \"{{version}}\""}, + {file="../../CHANGELOG.md", search="## unreleased", replace="## unreleased\n\n## {{version}} - {{date}}", exactly=1}, +] [[test]] name = "redis"