diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc01fe..599ec43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,4 +33,4 @@ All notable changes to this project will be documented in this file. See [conven - - - -Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto). \ No newline at end of file +Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto). diff --git a/cog.toml b/cog.toml index 6615617..f854665 100644 --- a/cog.toml +++ b/cog.toml @@ -9,6 +9,8 @@ branch_whitelist = ["main"] # `` will be interpreted as your target version # `` includes the version and the `tag_prefix` post_bump_hooks = [ + # Ensure CHANGELOG.md has a trailing newline + "sh -c 'f=CHANGELOG.md; test \"$(tail -c1 $f)\" && echo >> $f; git add $f && git commit --amend --no-edit'", # Re-tag release commit to ensure a signed tag "git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'"] diff --git a/justfile b/justfile index bd085b7..815e173 100644 --- a/justfile +++ b/justfile @@ -15,7 +15,7 @@ render: ! -name '.serena' \ ! -name 'template' ! -name 'includes' ! -name 'copier.yaml' \ ! -name 'hack' ! -name 'tests' ! -name 'pytest.ini' \ - ! -name 'flake.lock' \ + ! -name 'flake.lock' ! -name 'CHANGELOG.md' \ -exec rm -rf {} + # Regenerate from template copier copy --vcs-ref=HEAD --trust --defaults \ diff --git a/template/cog.toml.jinja b/template/cog.toml.jinja index b4b01c4..3268d11 100644 --- a/template/cog.toml.jinja +++ b/template/cog.toml.jinja @@ -9,6 +9,8 @@ branch_whitelist = ["{{ "." | gitdefaultbranch }}"] # `{{version}}` will be interpreted as your target version # `{{version_tag}}` includes the version and the `tag_prefix` post_bump_hooks = [ + # Ensure CHANGELOG.md has a trailing newline + "sh -c 'f=CHANGELOG.md; test \"$(tail -c1 $f)\" && echo >> $f; git add $f && git commit --amend --no-edit'", # Re-tag release commit to ensure a signed tag {% raw %}"git tag {{version_tag}} {{version_tag}}^{} --force --sign --message='Release {{version}}'"{% endraw %} ]