Skip to content

Commit

Permalink
build: show changes since url
Browse files Browse the repository at this point in the history
  • Loading branch information
autumnjolitz committed Jul 30, 2024
1 parent 50a7439 commit 05e86c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
id: version
run: |
echo "CURRENT_VERSION=$(grep -vE '^#' CURRENT_VERSION.txt | head -1)" >> "$GITHUB_OUTPUT"
echo "CHANGELOG_VERSION=$(invoke last-logged-changes | head -1 | cut -f2 -d' ')" >> "$GITHUB_OUTPUT"
echo "CHANGELOG_VERSION=$(invoke last-logged-changes | head -1 | cut -f2 -d' ' | tr -d '`')" >> "$GITHUB_OUTPUT"
echo "GIT_VERSION=$(echo '${{ github.ref_name }}' | sed 's/^.//')" >> "$GITHUB_OUTPUT"
-
Expand All @@ -156,7 +156,8 @@ jobs:
id: artifacts
run: |
invoke build --validate
invoke last-logged-changes | tee RELEASE_NOTES.rst
printf '%s\n=======================\n\n' '${{ steps.version.outputs.CURRENT_VERSION }}' | tee RELEASE_NOTES.rst
invoke last-logged-changes | tee -a RELEASE_NOTES.rst
invoke checksum | tee -a RELEASE_NOTES.rst
-
Expand Down
19 changes: 11 additions & 8 deletions CHANGES.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
{{ s }}
{%- endif -%}
{%- endmacro -%}
{#- macro: render_dashes_for -#}
{%- macro render_dashes_for(count) -%}
{{ '-' * (count + 2) }}
{%- endmacro -%}

{#- macro: render_section -#}
{%- macro render_section(section, default_type_name="") -%}
Expand All @@ -31,10 +35,6 @@
{%- endmacro -%}

{#- macro: render_version -#}
{#
`{{ version.tag or version.planned_tag }} <{{ version.url }}>`_
`Compare with {{ version.previous_version.tag|default("first commit") }} <{{ version.compare_url }}>`_
#}
{%- macro render_version(version, show_unreleased=False) -%}
{%- if version.tag or version.planned_tag -%}
{{ _render_version(version) }}
Expand All @@ -44,15 +44,18 @@
{%- endmacro -%}
{%- macro _render_version(version) -%}
{%- if version.tag or version.planned_tag -%}
Version {{ version.tag or version.planned_tag }}
-------------------
Version `{{ version.tag or version.planned_tag }} <{{ version.url }}>`_
{{ render_dashes_for(9 + (version.tag or version.planned_tag).__len__() + 2 + (version.url).__len__() + 3) }}

Released {% if version.date %}{{ version.date }}{%else%}YYYY-MM-DD{% endif %}

`Compare with {{ version.previous_version.tag|default("first commit") }} <{{ version.compare_url }}>`_ ({{ version.commits | length }} commits since)

Release {% if version.date %}{{ version.date }}{%else%}YYYY-MM-DD{% endif %}
{%- else -%}
Unreleased Version
-------------------

Release ????-??-?? {% if not (version.tag or version.planned_tag) %}(`latest <{{ version.compare_url }}>`_){% endif %}
Released ????-??-?? {% if not (version.tag or version.planned_tag) %}(`latest <{{ version.compare_url }}>`_){% endif %}
{%- endif %}
{% for type in changelog.sections %}
{%- if type in version.sections_dict %}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ input = 'CHANGES.rst'
convention='conventional'
marker_line = '.. |Changes|'
template = 'path:CHANGES.rst.template'
version_regex = '^Version (?P<version>v?[\w\d\.\+]+)'
version_regex = '^Version `?(?P<version>v?[\w\d\.\+]+)'
filter_commits = 'ade6cd882d2771f4abe9927e78614886f7f01ad6..'
parse_trailers = true
parse_refs = true
Expand Down

0 comments on commit 05e86c2

Please sign in to comment.