mirror of
https://github.com/tembo-pages/tembo-core.git
synced 2025-12-22 13:35:43 +00:00
chore: update cliff.toml & duties.py
This commit is contained in:
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
# https://tera.netlify.app/docs/#introduction
|
# https://tera.netlify.app/docs/#introduction
|
||||||
body = """
|
body = """
|
||||||
{% if version %}\
|
{% if version %}\
|
||||||
## [{{ version | trim_start_matches(pat="v") }}](https://github.com/tembo-pages/tembo-core/commits/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
|
## [{{ version }}](https://github.com/tembo-pages/tembo-core/commits/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||||
{% if previous.version %}\
|
{% if previous.version %}\
|
||||||
<small>[Compare with {{ previous.version }}](https://github.com/tembo-pages/tembo-core/compare/{{ previous.version }}...{{ version }})</small>
|
<small>[Compare with {{ previous.version }}](https://github.com/tembo-pages/tembo-core/compare/{{ previous.version }}...{{ version }})</small>
|
||||||
{% endif %}\
|
{% endif %}\
|
||||||
|
|||||||
14
duties.py
14
duties.py
@@ -13,6 +13,7 @@ from urllib.request import urlopen
|
|||||||
from duty import duty
|
from duty import duty
|
||||||
|
|
||||||
PACKAGE_NAME = "tembo"
|
PACKAGE_NAME = "tembo"
|
||||||
|
REPO_URL = "https://github.com/tembo-pages/tembo-core"
|
||||||
|
|
||||||
|
|
||||||
@duty(post=["export"])
|
@duty(post=["export"])
|
||||||
@@ -322,16 +323,25 @@ def check_dependencies(ctx):
|
|||||||
pty=True,
|
pty=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@duty
|
@duty
|
||||||
def changelog(ctx, planned_release: Optional[str] = None):
|
def changelog(ctx, planned_release: Optional[str] = None, previous_release: Optional[str] = None):
|
||||||
"""
|
"""
|
||||||
Generate a changelog with git-cliff.
|
Generate a changelog with git-cliff.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
ctx: The context instance (passed automatically).
|
ctx: The context instance (passed automatically).
|
||||||
planned_release (str, optional): The planned release version. Example: v1.0.2
|
planned_release (str, optional): The planned release version. Example: v1.0.2
|
||||||
|
previous_release (str, optional): The previous release version. Example: v1.0.1
|
||||||
"""
|
"""
|
||||||
generated_changelog = ctx.run(["git", "cliff", "-u", "-t", planned_release, "-s", "header"])[:-1]
|
generated_changelog: str = ctx.run(["git", "cliff", "-u", "-t", planned_release, "-s", "header"])[:-1]
|
||||||
|
if previous_release is not None:
|
||||||
|
generated_changelog: list = generated_changelog.splitlines()
|
||||||
|
generated_changelog.insert(
|
||||||
|
1,
|
||||||
|
f"<small>[Compare with {previous_release}]({REPO_URL}/compare/{previous_release}..{planned_release})</small>",
|
||||||
|
)
|
||||||
|
generated_changelog: str = "\n".join([line for line in generated_changelog]) + "\n"
|
||||||
new_changelog = []
|
new_changelog = []
|
||||||
|
|
||||||
changelog_file = pathlib.Path(".") / "CHANGELOG.md"
|
changelog_file = pathlib.Path(".") / "CHANGELOG.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user