Skip to content

Commit

Permalink
docs(changelog): add git-cliff (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeadNews authored Apr 8, 2024
1 parent 4297043 commit 53e1abb
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 15 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Main
on:
push:
branches: [main]
tags:
- "v*"
pull_request:
branches: [main]
release:
types: [created]

permissions:
contents: read
Expand Down Expand Up @@ -36,11 +36,11 @@ jobs:

publish-pypi:
name: Release to PyPI
if: github.event_name == 'release' && github.event.action == 'created'
if: github.ref_type == 'tag'
needs: [lint]
environment: pypi
permissions:
id-token: write
environment: pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -57,3 +57,27 @@ jobs:

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14

github-deploy:
name: Release to GitHub
if: github.ref_type == 'tag'
needs: [lint]
environment: github-releases
permissions:
contents: write
env:
CHANGELOG: https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md
PRERELEASE: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Create GitHub Release
run: |
gh release create ${{ github.ref_name }} \
--title ${{ github.ref_name }} \
--notes="See [the CHANGELOG](${{ env.CHANGELOG }}) for more details." \
--draft=${{ env.PRERELEASE }} \
--prerelease=${{ env.PRERELEASE }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[files]
extend-exclude = ["CHANGELOG.md"]

[default.extend-words]
hav = "hav"
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Changelog

## [0.0.6-alpha.5](https://github.com/DeadNews/dnfunc/compare/v0.0.5...v0.0.6-alpha.5) - 2024-04-08

### 🚜 Refactor

- imports and type aliases - ([d42cdbb](https://github.com/DeadNews/dnfunc/commit/d42cdbbb5536bcb7e8afb3725e238d67a55cc528))

### 📚 Documentation

- _(changelog)_ add `git-cliff` - ([8ccc357](https://github.com/DeadNews/dnfunc/commit/8ccc3576ca248b2694c9f1c53b7b034f78722706))
- _(changelog)_ add `git-cliff` - ([47fb52a](https://github.com/DeadNews/dnfunc/commit/47fb52acdd055e925eca2c75f24ff186120a6b25))
- _(changelog)_ add `git-cliff` - ([7f76aad](https://github.com/DeadNews/dnfunc/commit/7f76aadd21530659aae81d64b10dd432f3cbff28))
- update docstrings ([#139](https://github.com/DeadNews/dnfunc/issues/139)) - ([5ee9cd7](https://github.com/DeadNews/dnfunc/commit/5ee9cd785d33cb215f48c363aec8ab8d411c9ffe))

### 🎨 Styling

- update `ruff` settings ([#134](https://github.com/DeadNews/dnfunc/issues/134)) - ([9139b18](https://github.com/DeadNews/dnfunc/commit/9139b1808c980d8bedcd3744a9235ad3a0c76c97))

### 🧹 Chores

- _(makefile)_ update commands - ([4435085](https://github.com/DeadNews/dnfunc/commit/4435085ef497a7c14ed30fa7a475fef22d691d79))
- _(makefile)_ update commands - ([78ba320](https://github.com/DeadNews/dnfunc/commit/78ba320ba2341c4cbd7c4d02c6db736691000338))
- _(makefile)_ update commands - ([330d6be](https://github.com/DeadNews/dnfunc/commit/330d6be790d70d1b81ded8eb338612ed78b3eaf3))
- update `ruff` settings - ([d437f96](https://github.com/DeadNews/dnfunc/commit/d437f96f8ddc10659d4d4e0f88f9216824965fe2))

### ⚙️ CI/CD

- _(pre-commit)_ add `checkmake` hook - ([7b47d89](https://github.com/DeadNews/dnfunc/commit/7b47d89e5c12db6a6b17b0a74eb8df80d8a6b63b))

## [0.0.5](https://github.com/DeadNews/dnfunc/compare/v0.0.4...v0.0.5) - 2023-11-18

### 🧹 Chores

- rename `poe` task - ([e87871a](https://github.com/DeadNews/dnfunc/commit/e87871a084f69eb7431ef22fac610bec65b0d739))
- reorder `poe` tasks - ([5defe08](https://github.com/DeadNews/dnfunc/commit/5defe081e008d991ba85b6056a419313bbbd5273))
- replace `black` with `ruff` ([#118](https://github.com/DeadNews/dnfunc/issues/118)) - ([020efe8](https://github.com/DeadNews/dnfunc/commit/020efe8df9d1bbabacb03ba5d4c9a70980d43d1d))

### ⚙️ CI/CD

- use `pypi` deploy environment - ([17a3179](https://github.com/DeadNews/dnfunc/commit/17a3179250461bbab2e1972309d2c738313faece))
- move `pytest` command - ([07aa81f](https://github.com/DeadNews/dnfunc/commit/07aa81fddaaefb3516a11066332ff2ad6094a208))

### ⬆️ Dependencies

- _(deps)_ update dependency lvsfunc to v0.8.1 ([#115](https://github.com/DeadNews/dnfunc/issues/115)) - ([c207d76](https://github.com/DeadNews/dnfunc/commit/c207d76afc75d3ba7e0a3dc6eebe2c2397e73b9d))
- _(deps)_ update ([#111](https://github.com/DeadNews/dnfunc/issues/111)) - ([9de9ff9](https://github.com/DeadNews/dnfunc/commit/9de9ff95b7e4a918be2cb836cf735e4653c10a03))

## [0.0.4](https://github.com/DeadNews/dnfunc/compare/v0.0.3...v0.0.4) - 2023-07-16

### 🚜 Refactor

- move code from `__init__` ([#93](https://github.com/DeadNews/dnfunc/issues/93)) - ([4a6b004](https://github.com/DeadNews/dnfunc/commit/4a6b00424ea5e734843a5953e81cc06f98c5eb6a))

### 📚 Documentation

- fix `workflow` name - ([eae41cf](https://github.com/DeadNews/dnfunc/commit/eae41cffb861d03bce5eea6e3aef441191c4a4b9))

### 🧹 Chores

- ignore `PLR0913` ruff rule - ([3c3f1e1](https://github.com/DeadNews/dnfunc/commit/3c3f1e1ccc00d764a197022a69fcc7ad13ebe019))
- rename poetry `group` - ([c998dfd](https://github.com/DeadNews/dnfunc/commit/c998dfd845b0efe2355919d769753e626c3aed1a))

### ⚙️ CI/CD

- _(pre-commit)_ add `typos` hook - ([dedeef2](https://github.com/DeadNews/dnfunc/commit/dedeef2d1179098a8220a28fa9f4ee34f07412b8))
- _(renovate)_ adjust schedule - ([95a56d3](https://github.com/DeadNews/dnfunc/commit/95a56d3b27bc4557ff05bf3e851a6d0913509615))
- use `digest pinning` - ([81d14c5](https://github.com/DeadNews/dnfunc/commit/81d14c5e2eee9b4983deee4cefac9aa91b3838fa))
- update `workflows` ([#70](https://github.com/DeadNews/dnfunc/issues/70)) - ([5b04284](https://github.com/DeadNews/dnfunc/commit/5b042845e83bfc587567f49c1dc7c2e8ae11398d))

### ⬆️ Dependencies

- _(deps)_ update dependency vstools to v2.2.1 ([#87](https://github.com/DeadNews/dnfunc/issues/87)) - ([735c434](https://github.com/DeadNews/dnfunc/commit/735c434ca1b8a4bf767d6b4ba837807fbafbc187))
- _(deps)_ update dependency lvsfunc to ^0.8.0 ([#86](https://github.com/DeadNews/dnfunc/issues/86)) - ([a3113be](https://github.com/DeadNews/dnfunc/commit/a3113be70192b6022ec3e5cab94f2070525aded1))

## [0.0.3] - 2023-05-06

### 🚀 Features

- dev pr ([#64](https://github.com/DeadNews/dnfunc/issues/64)) - ([eb74ceb](https://github.com/DeadNews/dnfunc/commit/eb74cebf9b55eb1fcf98f0ef79f2e05f2a4fb088))

### 📚 Documentation

- _(README)_ format - ([28e7fbe](https://github.com/DeadNews/dnfunc/commit/28e7fbeeead6600c311aa821e2ef52ab8759cdc3))
- _(README)_ add deps link - ([06c3c4b](https://github.com/DeadNews/dnfunc/commit/06c3c4b91ef12378cfa371f08edab8972cc7611f))

<!-- generated by git-cliff -->
30 changes: 23 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
.PHONY: all clean test checks
.PHONY: all clean default install lock update checks pc test docs run

install-all: install pc-install
default: checks

install:
pre-commit install
poetry install --sync

pc-install:
pre-commit install
lock:
poetry lock --no-update

update-latest:
update:
poetry up --latest

checks: pc-run install lint
checks: pc install lint

pc-run:
pc:
pre-commit run -a

lint:
poetry run poe lint

test:
poetry run pytest

bumped:
git cliff --bumped-version

# make release-tag_name
# make release-$(git cliff --bumped-version)-alpha.0
release-%: checks
git cliff -o CHANGELOG.md --tag $*
pre-commit run --files CHANGELOG.md || pre-commit run --files CHANGELOG.md
git add CHANGELOG.md
git commit -m "chore(release): prepare for $*"
git push
git tag -a $* -m "chore(release): $*"
git push origin $*
git tag --verify $*
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

> A collection of Vapoursynth functions and wrappers
[![PyPI version](https://img.shields.io/pypi/v/dnfunc)](https://pypi.org/project/dnfunc)
[![Main](https://github.com/DeadNews/dnfunc/actions/workflows/main.yml/badge.svg)](https://github.com/DeadNews/dnfunc/actions/workflows/main.yml)
[![pre-commit.ci](https://results.pre-commit.ci/badge/github/DeadNews/dnfunc/main.svg)](https://results.pre-commit.ci/latest/github/DeadNews/dnfunc/main)
[![PyPI: Version](https://img.shields.io/pypi/v/dnfunc?logo=pypi&logoColor=white)](https://pypi.org/project/dnfunc)
[![GitHub: Release](https://img.shields.io/github/v/release/deadnews/dnfunc?logo=github&logoColor=white)](https://github.com/deadnews/dnfunc/releases/latest)
[![CI: Main](https://img.shields.io/github/actions/workflow/status/deadnews/dnfunc/main.yml?branch=main&logo=github&logoColor=white&label=main)](https://github.com/deadnews/dnfunc/actions/workflows/main.yml)
[![CI: pre-commit](https://results.pre-commit.ci/badge/github/DeadNews/dnfunc/main.svg)](https://results.pre-commit.ci/latest/github/deadnews/dnfunc/main)

## Deps

Expand Down
85 changes: 85 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

[changelog]
header = """
# Changelog\n
"""
postprocessors = [
{ pattern = '<REPO>', replace = "https://github.com/DeadNews/dnfunc" },
]
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% macro print_commit(commit) -%}
- {% if commit.scope %}_({{ commit.scope }})_ {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message }} - \
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
{% endmacro -%}
{% if version %}\
{% if previous.version %}\
## [{{ version | trim_start_matches(pat="v") }}]\
({{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif %}\
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits
| filter(attribute="scope")
| sort(attribute="scope") %}
{{ self::print_commit(commit=commit) }}
{%- endfor -%}
{% raw %}\n{% endraw %}\
{%- for commit in commits %}
{%- if not commit.scope -%}
{{ self::print_commit(commit=commit) }}
{% endif -%}
{% endfor -%}
{% endfor %}\n
"""
footer = """
<!-- generated by git-cliff -->
"""
trim = true

[git]
conventional_commits = true # parse the commits based on https://www.conventionalcommits.org
filter_unconventional = true # filter out the commits that are not conventional
split_commits = false # process each line of a commit as an individual commit
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" }, # Replace github issue numbers
{ pattern = " +", replace = " " }, # Remove multiple whitespaces
]
commit_parsers = [
{ message = "^(ci|build|chore)\\(deps.*\\)", skip = true },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^fix\\(deps.*\\)", group = "<!-- 92 -->⬆️ Dependencies" },
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug fixes" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore", group = "<!-- 7 -->🧹 Chores" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^build", group = "<!-- 9 -->👷 Build" },
{ message = "^ci", group = "<!-- 91 -->⚙️ CI/CD" },
{ message = "^revert", group = "<!-- 93 -->◀️ Revert" },
]
protect_breaking_commits = true
filter_commits = false # filter out the commits that are not matched by commit parsers
tag_pattern = "v[0-9].*" # regex for matching git tags
skip_tags = "" # drop commits from the changelog
ignore_tags = "rc|beta|alpha" # include ignored commits into the next tag
topo_order = false # sort the tags topologically
sort_commits = "newest" # sort the commits inside sections by oldest/newest order
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry_dynamic_versioning.backend"
name = "dnfunc"
version = "0.0.0"
description = "A collection of Vapoursynth functions and wrappers"
authors = ["DeadNews <aurczpbgr@mozmail.com>"]
authors = ["DeadNews <deadnewsgit@gmail.com>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/DeadNews/dnfunc"
Expand Down

0 comments on commit 53e1abb

Please sign in to comment.