From 37f8ae20b7fc2ede1979d755df7debac30567498 Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:40:46 +0100 Subject: [PATCH 1/3] docs: Create CITATION.cff CFF is a technology to make software citable. Therefore, a file named CITATION.cff needs to be stored in the repository's root. GitHub will then render a "Cite this repository" blob from it on the repository's landing page. --- CITATION.cff | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000000..192a4e00658 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,22 @@ +# Parser settings. +cff-version: 1.2.0 +message: Please cite this crate using these information. + +# Version information. +date-released: 2023-02-28 +version: 4.1.8 + +# Project information. +abstract: A full featured, fast Command Line Argument Parser for Rust +authors: + - alias: kbknapp + family-names: Knapp + given-names: Kevin B. + - name: The Clap Community +license: + - Apache-2.0 + - MIT +repository-artifact: https://crates.io/crates/clap +repository-code: https://github.com/clap-rs/clap +title: clap +url: https://docs.rs/clap From ee8231c69f966e27e7ebc65316a55e9730d0a0de Mon Sep 17 00:00:00 2001 From: Kevin Matthes Date: Thu, 9 Mar 2023 16:32:49 +0100 Subject: [PATCH 2/3] docs: 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 20fbda29428..5b4f9e8c331 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] From b8021a2a710b5840633c31c07f7a61e480121eaf Mon Sep 17 00:00:00 2001 From: Kevin Matthes <92332892+kevinmatthes@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:55:30 +0100 Subject: [PATCH 3/3] test: Add CFF Validation The CITATION.cff is validated with the official GitHub Action. --- .github/workflows/ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63eec09e098..5d88fb8b029 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: permissions: contents: none name: CI - needs: [test, check, docs, rustfmt, clippy] + needs: [test, check, docs, rustfmt, clippy, cffconvert] runs-on: ubuntu-latest steps: - name: Done @@ -187,3 +187,15 @@ jobs: run: make clippy-full - name: Lint (release) run: make clippy-release + cffconvert: + name: cffconvert + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: CFF validation + uses: citation-file-format/cffconvert-github-action@2.0.0 + with: + args: --validate