Skip to content

Commit

Permalink
docs: replace commitizen with git cliff
Browse files Browse the repository at this point in the history
This also completely updates the changelog.

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Jan 23, 2025
1 parent acfc73a commit 097888d
Show file tree
Hide file tree
Showing 4 changed files with 1,454 additions and 899 deletions.
19 changes: 0 additions & 19 deletions .github/CHANGELOG.md.j2

This file was deleted.

53 changes: 22 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,49 +231,40 @@ jobs:
# Fetch all tags
fetch-depth: 0

- name: Install git cliff and typos
uses: taiki-e/install-action@7e1dca9e0c58340bd342a8aa00ad82587936018d # v2.47.23
with:
tool: git-cliff,typos

- name: Download wheels and sdist
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: wheels
merge-multiple: true

- name: Set up uv
uses: astral-sh/setup-uv@b5f58b2abc5763ade55e4e9d0fe52cd1ff7979ca # v5.2.1
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install commitizen
run: uv tool install commitizen

- name: Update changelog
id: changelog
run: |
pip install --upgrade commitizen
run: git cliff --verbose
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

cz changelog \
--incremental \
--template .github/CHANGELOG.md.j2 \
--dry-run \
| tail -n+2 \
> ${{ runner.temp }}/changelog
echo -e "\n\n## Pull Requests\n\n" >> ${{ runner.temp }}/changelog
- name: Generate release changelog
id: release-changelog
run: |
git cliff \
--current \
--strip header \
--output ${{ runner.temp }}/release-changelog.md
cz changelog \
--incremental \
--template .github/CHANGELOG.md.j2
echo -e "\n\n## Pull Requests\n\n" >> ${{ runner.temp }}/release-changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Generate release
id: release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
with:
files: wheels/*
body_path: ${{ runner.temp }}/changelog
body_path: ${{ runner.temp }}/release-changelog.md
draft: false
prerelease: false
generate_release_notes: true
Expand All @@ -288,9 +279,9 @@ jobs:
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'chore: update changelog ${{ github.ref_name }}'
title: 'chore: update changelog'
commit-message: 'docs: update changelog for ${{ github.ref_name }}'
title: 'docs: update changelog'
body: |
This PR updates the changelog for ${{ github.ref_name }}.
branch: chore/update-changelog
branch: docs/update-changelog
base: main
Loading

0 comments on commit 097888d

Please sign in to comment.