From 3f2526e06fc4ebda17bfa7fef825bf3a1f368ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Fri, 6 Sep 2024 05:08:33 +0200 Subject: [PATCH 1/4] build: add basic changelog gen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- .config/cliff.toml | 96 ++++++++++++++++++++++++++++++++++++++++++++++ justfile | 3 ++ 2 files changed, 99 insertions(+) create mode 100644 .config/cliff.toml diff --git a/.config/cliff.toml b/.config/cliff.toml new file mode 100644 index 0000000..f4c339b --- /dev/null +++ b/.config/cliff.toml @@ -0,0 +1,96 @@ +# 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 footer +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 +] + +[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|^ci", group = "Miscellaneous Tasks" }, + { body = ".*security", group = "Security" }, + { message = "^revert", group = "◀️ Revert" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false +# filter out the commits that are not matched by commit parsers +filter_commits = false +# regex for matching git tags +# tag_pattern = "v[0-9].*" +# regex for skipping tags +# skip_tags = "" +# regex for ignoring tags +# ignore_tags = "" +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" +# limit the number of commits included in the changelog. +# limit_commits = 42 diff --git a/justfile b/justfile index b6e2f61..4933be4 100644 --- a/justfile +++ b/justfile @@ -4,3 +4,6 @@ update-deps: cargo hakari generate + +changelog: + git cliff -c .config/cliff.toml From e40b83733d95083e4d721255ef7f77594dffe6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Fri, 6 Sep 2024 05:10:38 +0200 Subject: [PATCH 2/4] build(deps): bump `flake.lock` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- flake.lock | 53 ++++++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/flake.lock b/flake.lock index 4516dda..237c644 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "advisory-db": { "flake": false, "locked": { - "lastModified": 1723840407, - "narHash": "sha256-AZI593yLh4lcKJdAnnjyLMKUm5PMDpFy1APIYFURLyI=", + "lastModified": 1725558019, + "narHash": "sha256-4dhSDMbVg+cZ3BBCXl7wJ08Co5wKQjoT+OkBxbOJbZo=", "owner": "rustsec", "repo": "advisory-db", - "rev": "201638b35a3e85b7794e84cc73f876d7a2b7ad51", + "rev": "9f0ebadc1ce8ef9b7ee7ba4a6128b5aa247a95d1", "type": "github" }, "original": { @@ -17,17 +17,12 @@ } }, "crane": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, "locked": { - "lastModified": 1724006180, - "narHash": "sha256-PVxPj0Ga2fMYMtcT9ARCthF+4U71YkOT7ZjgD/vf1Aw=", + "lastModified": 1725409566, + "narHash": "sha256-PrtLmqhM6UtJP7v7IGyzjBFhbG4eOAHT6LPYOFmYfbk=", "owner": "ipetkov", "repo": "crane", - "rev": "7ce92819802bc583b7e82ebc08013a530f22209f", + "rev": "7e4586bad4e3f8f97a9271def747cf58c4b68f3c", "type": "github" }, "original": { @@ -44,11 +39,11 @@ "rust-analyzer-src": [] }, "locked": { - "lastModified": 1724308100, - "narHash": "sha256-1lP786QhspMdDNJGv2qep27BM9Dnce+7scwp1e49rKs=", + "lastModified": 1725517947, + "narHash": "sha256-sB8B3M6CS0Y0rnncsCPz0htg6LoC1RbI2Mq9K88tSOk=", "owner": "nix-community", "repo": "fenix", - "rev": "37d8c6b53394b9ac18af2e045bb92aaf6e412881", + "rev": "96072c2af73da16c7db013dbb8c8869000157235", "type": "github" }, "original": { @@ -184,11 +179,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1724271409, - "narHash": "sha256-z4nw9HxkaXEn+5OT8ljLVL2oataHvAzUQ1LEi8Fp+SY=", + "lastModified": 1725534445, + "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "36a9aeaaa17a2d4348498275f9fe530cd4f9e519", + "rev": "9bb1e7571aadf31ddb4af77fc64b2d59580f9a39", "type": "github" }, "original": { @@ -200,11 +195,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1724242322, - "narHash": "sha256-HMpK7hNjhEk4z5SFg5UtxEio9OWFocHdaQzCfW1pE7w=", + "lastModified": 1725407940, + "narHash": "sha256-tiN5Rlg/jiY0tyky+soJZoRzLKbPyIdlQ77xVgREDNM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "224042e9a3039291f22f4f2ded12af95a616cca0", + "rev": "6f6c45b5134a8ee2e465164811e451dcb5ad86e3", "type": "github" }, "original": { @@ -230,11 +225,11 @@ ] }, "locked": { - "lastModified": 1724227338, - "narHash": "sha256-TuSaYdhOxeaaE9885mFO1lZHHax33GD5A9dczJrGUjw=", + "lastModified": 1725513492, + "narHash": "sha256-tyMUA6NgJSvvQuzB7A1Sf8+0XCHyfSPRx/b00o6K0uo=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "6cedaa7c1b4f82a266e5d30f212273e60d62cb0d", + "rev": "7570de7b9b504cfe92025dd1be797bf546f66528", "type": "github" }, "original": { @@ -266,11 +261,11 @@ ] }, "locked": { - "lastModified": 1724293269, - "narHash": "sha256-x/XhOAszT/ejditCHUtGOjQcVg2AQhrC/QVew3i7kTI=", + "lastModified": 1725589472, + "narHash": "sha256-+OB00N6Yql/ZRQQkQ0PNnxfW2tH89DHnv29hBS7tXMM=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6dc6d34a3a217457d7044dcce32b6d537480a6a1", + "rev": "2b00881d2ff72174cffdc007238cb6bedd6e1d8e", "type": "github" }, "original": { @@ -316,11 +311,11 @@ ] }, "locked": { - "lastModified": 1723808491, - "narHash": "sha256-rhis3qNuGmJmYC/okT7Dkc4M8CeUuRCSvW6kC2f3hBc=", + "lastModified": 1725271838, + "narHash": "sha256-VcqxWT0O/gMaeWTTjf1r4MOyG49NaNxW4GHTO3xuThE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "1d07739554fdc4f8481068f1b11d6ab4c1a4167a", + "rev": "9fb342d14b69aefdf46187f6bb80a4a0d97007cd", "type": "github" }, "original": { From c125b77683f1166bf3fc142dd26e07c6fbd86077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Fri, 6 Sep 2024 05:11:57 +0200 Subject: [PATCH 3/4] refactor: deduplicate `nix-weather` cargo manifest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- Cargo.toml | 6 +++++- crates/nix-weather/Cargo.toml | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b940fa4..653a2c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,13 @@ resolver = "2" members = ["crates/*", "crates/workspace-hack"] [workspace.package] +description = "Guix weather, for nix!" version = "0.0.1" edition = "2021" -rust-version = "1.80" +rust-version = "1.81" +license = "EUPL-1.2" +authors = ["Christina Sørensen "] +categories = ["command-line-utilities"] [workspace.metadata.crane] name = "nix-weather" diff --git a/crates/nix-weather/Cargo.toml b/crates/nix-weather/Cargo.toml index 8140899..fde77fb 100644 --- a/crates/nix-weather/Cargo.toml +++ b/crates/nix-weather/Cargo.toml @@ -5,14 +5,14 @@ [package] name = "nix-weather" -description = "Guix weather, for nix!" -authors = ["Christina Sørensen "] -categories = ["command-line-utilities"] -rust-version = "1.80.1" -license = "EUPL-1.2" +description.workspace = true +authors.workspace = true +categories.workspace = true +license.workspace = true +rust-version.workspace = true version.workspace = true edition.workspace = true -publish = false +publish = true build = "build.rs" [dependencies] From 6ec1ba74a800217c7399f2268b7e1eaee9c8d114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Fri, 6 Sep 2024 05:26:14 +0200 Subject: [PATCH 4/4] ci(audit): fix multiple `audit.yml` flows spawning on same commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- .forgejo/workflows/audit.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.forgejo/workflows/audit.yml b/.forgejo/workflows/audit.yml index b98bf6b..dfe0929 100644 --- a/.forgejo/workflows/audit.yml +++ b/.forgejo/workflows/audit.yml @@ -7,11 +7,7 @@ on: schedule: - cron: '0 0 * * *' push: - paths: - - '.github/workflows/audit.yml' - - '**/Cargo.toml' - - '**/Cargo.lock' - - 'deny.toml' + branches: [main] pull_request: branches: [main] jobs: