From 2a52e66bc0229b67d6303d7175f72603bc9547df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 12:47:55 +0100 Subject: [PATCH 1/2] feat: add git-cliff to generate changelogs This should make the project a bit more "official" c: --- cliff.toml | 85 +++++++++++++++++++++++++++++++++++++++ flake-modules/default.nix | 9 +++-- flake-modules/package.nix | 1 + 3 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 cliff.toml diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..1502859 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,85 @@ +# git-cliff ~ default configuration file +# https://git-cliff.org/docs/configuration +# +# Lines starting with "#" are comments. +# Configuration options are organized into tables and keys. +# See documentation for more information on available options. + +[changelog] +# template for the changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# template for the changelog body +# https://keats.github.io/tera/docs/#introduction +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits %} + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | upper_first }}\ + {% endfor %} +{% endfor %}\n +""" +# template for the changelog footer +footer = """ + +""" +# remove the leading and trailing s +trim = true +# postprocessors +postprocessors = [ + # { pattern = '', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL +] +# render body even when there are no releases to process +# render_always = true +# output file path +# output = "test.md" + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + # Replace issue numbers + #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, + # Check spelling of the commit with https://github.com/crate-ci/typos + # If the spelling is incorrect, it will be automatically fixed. + #{ pattern = '.*', replace_command = 'typos --write-changes -' }, +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "๐Ÿš€ Features" }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^doc", group = "๐Ÿ“š Documentation" }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor", group = "๐Ÿšœ Refactor" }, + { message = "^style", group = "๐ŸŽจ Styling" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore: bump version", skip = true }, + { message = "^chore|^ci", group = "โš™๏ธ Miscellaneous Tasks" }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, + { message = ".*", group = "๐Ÿ’ผ Other" }, +] +# filter out the commits that are not matched by commit parsers +filter_commits = false +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" diff --git a/flake-modules/default.nix b/flake-modules/default.nix index f4d7398..27ecc50 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -22,10 +22,11 @@ }; devShells.default = pkgs.mkShellNoCC { - packages = [ - pkgs.cargo-insta - pkgs.cargo-udeps - pkgs.mold + packages = with pkgs; [ + cargo-insta + cargo-udeps + mold + git-cliff ]; }; }; diff --git a/flake-modules/package.nix b/flake-modules/package.nix index 86fc8b0..7e8bd52 100644 --- a/flake-modules/package.nix +++ b/flake-modules/package.nix @@ -62,6 +62,7 @@ packages = { inherit webnsupdate; + inherit (pkgs) git-cliff; default = webnsupdate; cargo-update = pkgs.writeShellApplication { name = "cargo-update-lockfile"; -- 2.47.0 From 7bc103e861cc1251bc52791c025540df11a37884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 13:17:16 +0100 Subject: [PATCH 2/2] chore: generate base changelog --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b7d9e2f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,88 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [unreleased] + +### ๐Ÿš€ Features + +- *(ci)* Generate package size report +- Add git-cliff to generate changelogs + +### ๐Ÿ› Bug Fixes + +- *(webnsupdate)* Reduce binary size + +### โš™๏ธ Miscellaneous Tasks + +- *(flake.lock)* Update inputs +- Cargo update + +## [0.3.2] - 2024-11-23 + +### ๐Ÿš€ Features + +- *(ci)* Check depends on build +- Upgrade clap_verbosity_flag +- Replace axum-auth with tower_http +- Release new version + +### ๐Ÿ› Bug Fixes + +- *(clippy)* Enable more lints and fix issues + +### ๐Ÿšœ Refactor + +- Reorganize main.rs + +### โš™๏ธ Miscellaneous Tasks + +- Cargo update +- Update flake inputs + +## [0.3.1] - 2024-10-28 + +### ๐Ÿ› Bug Fixes + +- Overlay was broken T-T + +### โš™๏ธ Miscellaneous Tasks + +- Next dev version + +## [0.3.0] - 2024-10-28 + +### ๐Ÿš€ Features + +- *(ci)* Auto-update rust deps +- Refactor and add ip saving +- Add -v verbosity flag +- Use treefmt-nix and split up flake.nix +- Add NixOS VM tests +- Switch to crane + +### ๐Ÿ› Bug Fixes + +- *(fmt)* Use nixfmt-rfc-style +- *(default.nix)* Small issues here and there +- *(ci)* Do not use a name when logging in + +### ๐Ÿšœ Refactor + +- *(flake)* Use flake-parts + +### โš™๏ธ Miscellaneous Tasks + +- Updarte deps +- *(flake.lock)* Update inputs +- Cargo update +- Cargo update +- Cargo update + +## [0.2.0] - 2024-06-02 + +### ๐Ÿ’ผ Other + +- Init at version 0.1.0 + + -- 2.47.0