WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 65a323d

Browse files
committed
Add auto generated changelog to releases
1 parent c292507 commit 65a323d

File tree

2 files changed

+65
-4
lines changed

2 files changed

+65
-4
lines changed

.github/cliff.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# git-cliff configuration for OxideMod
2+
# Generates changelog in the format:
3+
# ## Changes
4+
# - Fix memory leak ([#123](url)) @username
5+
# - Direct commit ([a1b2c3d](url)) @username
6+
# **Full Changelog**: compare_url
7+
8+
[changelog]
9+
header = ""
10+
body = """
11+
## Changes
12+
{% for commit in commits -%}
13+
{% if commit.remote.pr_number -%}
14+
- {{ commit.remote.pr_title | trim }} ([#{{ commit.remote.pr_number }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.remote.pr_number }})) @{{ commit.remote.username }}
15+
{% else -%}
16+
- {{ commit.message | split(pat="\n") | first | trim }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/commit/{{ commit.id }})){% if commit.remote.username %} @{{ commit.remote.username }}{% endif %}
17+
{% endif -%}
18+
{% endfor %}
19+
{% if previous.version %}
20+
**Full Changelog**: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/compare/{{ previous.version }}...{{ version }}
21+
{% endif %}
22+
"""
23+
footer = ""
24+
trim = true
25+
26+
[git]
27+
# Include all commits (not just conventional)
28+
conventional_commits = false
29+
filter_unconventional = false
30+
split_commits = false
31+
32+
# Skip merge commits to avoid duplicates
33+
commit_parsers = [
34+
{ message = "^Merge pull request", skip = true },
35+
{ message = "^Merge branch", skip = true },
36+
{ message = ".*", group = "Changes" },
37+
]
38+
39+
# Link parser for issues/PRs mentioned in commit messages
40+
link_parsers = [
41+
{ pattern = "#(\\d+)", href = "https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/issues/$1" },
42+
]
43+
44+
# Tag settings - matches your version format (e.g., 2.0.1234)
45+
tag_pattern = "[0-9]+\\.[0-9]+\\.[0-9]+"
46+
sort_commits = "newest"

.github/workflows/release.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ jobs:
2626
runs-on: ubuntu-22.04
2727
needs: build
2828
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
ref: master
33+
fetch-depth: 0
34+
35+
- name: Generate Changelog
36+
uses: orhun/git-cliff-action@v4
37+
id: changelog
38+
with:
39+
config: .github/cliff.toml
40+
args: --unreleased --tag ${{ needs.build.outputs.version }}
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_REPO: ${{ github.repository }}
44+
2945
- name: Download Artifacts
3046
uses: actions/download-artifact@v4
3147
with:
@@ -39,10 +55,9 @@ jobs:
3955
artifacts/Oxide.*.zip
4056
tag_name: ${{ needs.build.outputs.version }}
4157
fail_on_unmatched_files: true
42-
target_commitish: ${{ github. sha }}
58+
target_commitish: ${{ github.sha }}
4359
token: ${{ secrets.GITHUB_TOKEN }}
44-
body: |
45-
See https://umod.org/games/rust for changes
60+
body: ${{ steps.changelog.outputs.content }}
4661

4762
update-docs:
4863
name: Update Documentation
@@ -65,4 +80,4 @@ jobs:
6580
git config --global user.name oxidemod-bot
6681
git add docs.json
6782
git diff-index --quiet HEAD || git commit -m "Update hooks index to ${{ needs.build.outputs.version }}"
68-
git push
83+
git push

0 commit comments

Comments
 (0)