From db85bf55f4fd479b6468dbebfef3660826309884 Mon Sep 17 00:00:00 2001 From: Kevin Matthes Date: Thu, 9 Mar 2023 16:32:49 +0100 Subject: [PATCH] ci: Add Replacement Rules for CITATION.cff The regular expression for the release date update is taken from the GitHub Action `kevinmatthes/cff-release-today@v0.5.2` which uses this one, too. License issues should not arise as I am the author of that GitHub Action. The regular expression for the version update is designed to also work with version parts consisting of multiple digits. It was tested successfully with the example versions `1.2.3` and `1.2.30` in CITATION.cff. --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 20fbda294285..5b4f9e8c3311 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,6 +57,8 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, {file="CHANGELOG.md", search="", replace="\n## [Unreleased] - ReleaseDate\n", exactly=1}, {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/clap-rs/clap/compare/{{tag_name}}...HEAD", exactly=1}, + {file="CITATION.cff", search="^date-released: ....-..-..", replace="date-released: {{date}}"}, + {file="CITATION.cff", search="^version: .+\\..+\\..+", replace="version: {{version}}"}, ] [features]