diff --git a/.github/workflows/bump_version.py b/.github/workflows/bump_version.py index 5d937d9..523cae8 100644 --- a/.github/workflows/bump_version.py +++ b/.github/workflows/bump_version.py @@ -90,12 +90,8 @@ def get_release_notes(tag: str = Updater.new_version): found_notes = True else: found_notes = False - elif line.startswith("[unreleased]: ") and found_notes: - found_notes = False elif found_notes: buf += line - elif line.startswith(tag_pattern + ": "): - buf += line.replace(tag_pattern, "Full commit diff", 1) return title.rstrip(), buf.strip() diff --git a/CHANGELOG.md b/CHANGELOG.md index d5791bf..9098c53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [Unreleased] - 2024-09-21 to present ### 🚀 Added -- Add a change log in [`9bfab31`](https://github.com/cpp-linter/cpp_linter_rs/commit/9bfab318394814d2515f3959f744d60a12d415f1) +- Add changelog and automate version bump and release workflows by @2bndy5 in [#42](https://github.com/cpp-linter/cpp_linter_rs/pull/42) ### 🛠️ Fixed - Fix typo in node-binding/README by @2bndy5 in [`7732676`](https://github.com/cpp-linter/cpp_linter_rs/commit/7732676e03941a37a4fb5b474d319c640689985a) +### 📦 Dependency updates + +- Bump the npm group with 2 updates by @dependabot[bot] in [#43](https://github.com/cpp-linter/cpp_linter_rs/pull/43) + ### 📝 Documentation - Release trial follow up by @2bndy5 in [#41](https://github.com/cpp-linter/cpp_linter_rs/pull/41) @@ -23,6 +27,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 🗨️ Changed - Gimme them badges by @2bndy5 in [`c0f1ea5`](https://github.com/cpp-linter/cpp_linter_rs/commit/c0f1ea516ee6efdf1137884cbc2e99e4ce1d4a11) +- Move logic from py script to jinja template (release CI) in [`bc05419`](https://github.com/cpp-linter/cpp_linter_rs/commit/bc05419920e15704352d344a4fa7da67824cc776) + +[Unreleased]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc4...HEAD + +Full commit diff: [`v2.0.0-rc4...HEAD`][Unreleased] ## [2.0.0-rc4] - 2024-09-21 @@ -34,6 +43,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump version to v2.0.0-rc4 by @2bndy5 in [`3e98e20`](https://github.com/cpp-linter/cpp_linter_rs/commit/3e98e20d2405b909b038ff87911dc0d5457613cc) +[2.0.0-rc4]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc3...v2.0.0-rc4 + +Full commit diff: [`v2.0.0-rc3...v2.0.0-rc4`][2.0.0-rc4] + ## [2.0.0-rc3] - 2024-09-21 ### 🗨️ Changed @@ -41,6 +54,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [node] add life cycle script prepublishOnly by @2bndy5 in [`55650ea`](https://github.com/cpp-linter/cpp_linter_rs/commit/55650ea96aac628023acb120525d674bcf17a529) - Bump version to v2.0.0-rc3 by @2bndy5 in [`070c5f7`](https://github.com/cpp-linter/cpp_linter_rs/commit/070c5f75f15d0190ee0204992165673c8f16c47d) +[2.0.0-rc3]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc2...v2.0.0-rc3 + +Full commit diff: [`v2.0.0-rc2...v2.0.0-rc3`][2.0.0-rc3] + ## [2.0.0-rc2] - 2024-09-21 ### 🚀 Added @@ -58,6 +75,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Some cleanup from release trials by @2bndy5 in [`25c3951`](https://github.com/cpp-linter/cpp_linter_rs/commit/25c3951b0ecef9e078ea71932c9401ad8abc2a28) - Bump version to v2.0.0-rc2 by @2bndy5 in [`ebcb6c4`](https://github.com/cpp-linter/cpp_linter_rs/commit/ebcb6c4941fbaa8147c768252d6d7d9adcfa3bb3) +[2.0.0-rc2]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc1...v2.0.0-rc2 + +Full commit diff: [`v2.0.0-rc1...v2.0.0-rc2`][2.0.0-rc2] + ## [2.0.0-rc1] - 2024-09-19 ### 🚀 Added @@ -114,10 +135,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Refactor files by @2bndy5 in [#38](https://github.com/cpp-linter/cpp_linter_rs/pull/38) - Metadata changes by @2bndy5 in [`f4237ae`](https://github.com/cpp-linter/cpp_linter_rs/commit/f4237ae593e468eca0e63169c9360e97bd6e1f26) -[unreleased]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc4...HEAD -[2.0.0-rc4]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc3...v2.0.0-rc4 -[2.0.0-rc3]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc2...v2.0.0-rc3 -[2.0.0-rc2]: https://github.com/cpp-linter/cpp_linter_rs/compare/v2.0.0-rc1...v2.0.0-rc2 [2.0.0-rc1]: https://github.com/cpp-linter/cpp_linter_rs/compare/2e25fec0a447df24d0bcc1b80f6624040bab755e...v2.0.0-rc1 +Full commit diff: [`2e25fec...v2.0.0-rc1`][2.0.0-rc1] + diff --git a/cliff.toml b/cliff.toml index 85eb084..71dff74 100644 --- a/cliff.toml +++ b/cliff.toml @@ -17,15 +17,19 @@ body = """ {%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} +{%- set UNRELEASED = "Unreleased" -%} +{%- set init_commit = "2e25fec0a447df24d0bcc1b80f6624040bab755e" -%} +{%- set this_version = UNRELEASED -%} {% if version -%} - ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + {%- set this_version = version | trim_start_matches(pat="v") -%} + ## [{{ this_version }}] - {{ timestamp | date(format="%Y-%m-%d") }} {%- if message %} > {{ message }} {%- endif %} {% else -%} - ## [Unreleased] + ## [{{ UNRELEASED }}] - {{ previous.timestamp | date(format="%Y-%m-%d") }} to present {% endif -%} {% for group, commits in commits | group_by(attribute="group") %} @@ -39,9 +43,25 @@ body = """ [`{{ commit.id | truncate(length=7, end="") }}`]({{ self::remote_url() }}/commit/{{commit.id }}) {%- endif -%} {% endfor %} -{% endfor %} +{% endfor -%} + +{% set first_commit = previous.version -%} +{%- set last_commit = "HEAD" -%} +{% if version -%} + {%- set last_commit = version -%} + {%- if not previous.version -%} + {#- If this is the first versioned release, use the initial commit -#} + {%- set first_commit = init_commit -%} + {%- endif -%} +{%- endif %} +[{{ this_version }}]: {{ self::remote_url() }}/compare/{{ first_commit }}...{{ last_commit }} -{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} +Full commit diff: [`{% if previous.version -%} + {{ first_commit }} +{%- else -%} + {{ init_commit | truncate(length=7, end="") }} +{%- endif %}...{{ last_commit }}`][{{ this_version }}] +{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} ## New Contributors {%- endif -%} @@ -54,28 +74,12 @@ body = """ """ # template for the changelog footer footer = """ -{%- macro remote_url() -%} - https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} -{%- endmacro -%} - -{% for release in releases -%} - {% if release.version -%} - {% if release.previous.version -%} - [{{ release.version | trim_start_matches(pat="v") }}]: \ - {{ self::remote_url() }}/compare/{{ release.previous.version }}...{{ release.version }} - {% endif -%} - {% else -%} - [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}...HEAD - {% endif -%} -{% endfor -%} -[2.0.0-rc1]: https://github.com/cpp-linter/cpp_linter_rs/compare/2e25fec0a447df24d0bcc1b80f6624040bab755e...v2.0.0-rc1 - """ # remove the leading and trailing whitespace from the templates trim = true # The file path for output. This can be overridden with `--output` CLI arg -output = "CHANGELOG.md" +# output = "CHANGELOG.md" [git] # parse the commits based on https://www.conventionalcommits.org