Skip to content

Commit 9794d89

Browse files
Merge pull request #102 from DylanDevelops/ravel/improved-changelog
ci: Improved changelog formatting and brew setup
2 parents 4590a7b + 3a4ea0c commit 9794d89

3 files changed

Lines changed: 63 additions & 46 deletions

File tree

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,22 @@ jobs:
2222
with:
2323
go-version: "1.25"
2424

25+
- name: Generate Release Notes
26+
uses: orhun/git-cliff-action@v4
27+
with:
28+
config: cliff.toml
29+
args: --latest --strip header
30+
env:
31+
OUTPUT: release-notes.md
32+
GITHUB_REPO: ${{ github.repository }}
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
2535
- name: Run GoReleaser
2636
uses: goreleaser/goreleaser-action@v7
2737
with:
2838
distribution: goreleaser
2939
version: "~> v2"
30-
args: release --clean
40+
args: release --clean --release-notes=release-notes.md
3141
env:
3242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3343
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}

β€Ž.goreleaser.ymlβ€Ž

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ version: 2
33
before:
44
hooks:
55
- go mod tidy
6+
- mkdir -p completions
7+
- sh -c 'go run main.go completion bash > completions/tmpo.bash'
8+
- sh -c 'go run main.go completion zsh > completions/tmpo.zsh'
9+
- sh -c 'go run main.go completion fish > completions/tmpo.fish'
610

711
builds:
812
# macOS (both Intel and Apple Silicon)
@@ -44,32 +48,38 @@ builds:
4448

4549
archives:
4650
- id: windows-zip
47-
builds: [windows]
51+
ids: [windows]
4852
name_template: >-
4953
{{ .ProjectName }}_
5054
{{- .Version }}_
5155
{{- title .Os }}_
5256
{{- if eq .Arch "amd64" }}x86_64
5357
{{- else if eq .Arch "386" }}i386
5458
{{- else }}{{ .Arch }}{{ end }}
55-
format: zip
59+
formats: [zip]
5660
files:
5761
- README.md
5862
- LICENSE
63+
- completions/tmpo.bash
64+
- completions/tmpo.zsh
65+
- completions/tmpo.fish
5966

6067
- id: unix-targz
61-
builds: [macos, linux]
68+
ids: [macos, linux]
6269
name_template: >-
6370
{{ .ProjectName }}_
6471
{{- .Version }}_
6572
{{- title .Os }}_
6673
{{- if eq .Arch "amd64" }}x86_64
6774
{{- else if eq .Arch "386" }}i386
6875
{{- else }}{{ .Arch }}{{ end }}
69-
format: tar.gz
76+
formats: [tar.gz]
7077
files:
7178
- README.md
7279
- LICENSE
80+
- completions/tmpo.bash
81+
- completions/tmpo.zsh
82+
- completions/tmpo.fish
7383

7484
checksum:
7585
name_template: 'checksums.txt'
@@ -78,40 +88,6 @@ checksum:
7888
snapshot:
7989
version_template: "{{ incpatch .Version }}-next"
8090

81-
changelog:
82-
sort: asc
83-
groups:
84-
- title: ✨ Features
85-
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
86-
order: 0
87-
- title: πŸ› Bug Fixes
88-
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
89-
order: 1
90-
- title: πŸš€ Performance Improvements
91-
regexp: '^.*?perf(\([[:word:]]+\))??!?:.+$'
92-
order: 2
93-
- title: πŸ”¨ Refactoring
94-
regexp: '^.*?refactor(\([[:word:]]+\))??!?:.+$'
95-
order: 3
96-
- title: πŸ“š Documentation
97-
regexp: '^.*?docs?(\([[:word:]]+\))??!?:.+$'
98-
order: 4
99-
- title: πŸ”§ Build & Dependencies
100-
regexp: '^.*?(build|ci)(\([[:word:]]+\))??!?:.+$'
101-
order: 5
102-
- title: 🧹 Maintenance
103-
regexp: '^.*?chore(\([[:word:]]+\))??!?:.+$'
104-
order: 6
105-
- title: πŸ“¦ Other Changes
106-
order: 999
107-
filters:
108-
exclude:
109-
- '^test:'
110-
- Merge pull request
111-
- Merge remote-tracking branch
112-
- Merge branch
113-
- go mod tidy
114-
11591
release:
11692
github:
11793
owner: DylanDevelops
@@ -121,7 +97,7 @@ release:
12197
name_template: "tmpo {{.Version}}"
12298

12399
# Homebrew
124-
brews:
100+
homebrew_casks:
125101
- name: tmpo
126102
repository:
127103
owner: DylanDevelops
@@ -133,9 +109,7 @@ brews:
133109
homepage: "https://github.com/DylanDevelops/tmpo"
134110
description: "Minimal CLI time tracker for developers"
135111
license: "MIT"
136-
skip_upload: false
137-
install: |
138-
bin.install "tmpo"
139-
generate_completions_from_executable(bin/"tmpo", "completion")
140-
test: |
141-
system bin/"tmpo", "--version"
112+
completions:
113+
bash: "completions/tmpo.bash"
114+
zsh: "completions/tmpo.zsh"
115+
fish: "completions/tmpo.fish"

β€Žcliff.tomlβ€Ž

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[changelog]
2+
body = """
3+
{% for group, commits in commits | group_by(attribute="group") %}
4+
### {{ group | striptags | trim }}
5+
{% for commit in commits -%}
6+
- {% if commit.breaking %}[breaking] {% endif %}{{ commit.message | split(pat="\\n") | first | upper_first }}{% if commit.remote.username %} by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}){% endif %}
7+
{% endfor %}
8+
9+
{% endfor %}
10+
{% set new_contributors = github.contributors | filter(attribute="is_first_time", value=true) %}
11+
{% if new_contributors | length > 0 %}
12+
### 🌟 New Contributors
13+
{% for contributor in new_contributors -%}
14+
- [@{{ contributor.username }}](https://github.com/{{ contributor.username }}) made their first contribution!
15+
{% endfor %}
16+
{% endif %}
17+
"""
18+
trim = true
19+
20+
[git]
21+
conventional_commits = true
22+
filter_unconventional = false
23+
commit_parsers = [
24+
{ message = "^feat", group = "✨ Features" },
25+
{ message = "^fix", group = "πŸ› Bug Fixes" },
26+
{ message = "^perf", group = "πŸš€ Performance Improvements" },
27+
{ message = "^refactor", group = "πŸ”¨ Refactoring" },
28+
{ message = "^docs?", group = "πŸ“š Documentation" },
29+
{ message = "^(build|ci)", group = "πŸ”§ Build & Dependencies" },
30+
{ message = "^chore", group = "🧹 Maintenance" },
31+
{ message = "^Merge ", skip = true },
32+
{ message = ".*", group = "πŸ“¦ Other Changes" },
33+
]

0 commit comments

Comments
Β (0)