Skip to content

Commit 220e7ac

Browse files
ci: add github actions for changelog generation
Merge pull request #12 from bartosz-skejcik/master
2 parents 3f88b5c + addefa8 commit 220e7ac

16 files changed

Lines changed: 710 additions & 11 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Generate General Changelog"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
generate-changelog:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Generate changelog
20+
uses: orhun/git-cliff-action@v4
21+
with:
22+
config: cliff.toml
23+
args: --verbose
24+
env:
25+
OUTPUT: CHANGELOG.md
26+
GITHUB_REPO: ${{ github.repository }}
27+
28+
- name: Commit
29+
run: |
30+
git checkout <branch>
31+
git config user.name 'github-actions[bot]'
32+
git config user.email 'github-actions[bot]@users.noreply.github.com'
33+
set +e
34+
git add CHANGELOG.md
35+
git commit -m "Update changelog"
36+
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git master
37+

.github/workflows/release.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,41 @@ on:
99
# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release.
1010

1111
jobs:
12-
publish-tauri:
12+
changelog:
13+
name: Generate changelog
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_body: ${{ steps.git-cliff.outputs.content }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Generate a changelog
24+
uses: orhun/git-cliff-action@v4
25+
id: git-cliff
26+
with:
27+
config: cliff.toml
28+
args: -vv --latest --strip header
29+
env:
30+
OUTPUT: CHANGES.md
31+
GITHUB_REPO: ${{ github.repository }}
32+
33+
# use release body in another job
34+
# upload:
35+
# name: Upload the release
36+
# needs: changelog
37+
# runs-on: ubuntu-latest
38+
# steps:
39+
# - name: Upload the binary releases
40+
# uses: svenstaro/upload-release-action@v2
41+
# with:
42+
# file: binary_release.zip
43+
# repo_token: ${{ secrets.GITHUB_TOKEN }}
44+
# tag: ${{ github.ref }}
45+
# body: ${{ needs.changelog.outputs.release_body }}
46+
publish-app:
1347
permissions:
1448
contents: write
1549
strategy:
@@ -47,6 +81,17 @@ jobs:
4781
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
4882
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
4983
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
84+
- name: Restore Cargo dependencies
85+
uses: actions/cache@v3
86+
with:
87+
path: |
88+
~/src-tauri/.cargo/bin/
89+
~/src-tauri/.cargo/registry/index/
90+
~/src-tauri/.cargo/registry/cache/
91+
~/src-tauri/.cargo/git/db/
92+
~/src-tauri/target/
93+
key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }}
94+
restore-keys: ${{ runner.os }}-cargo-
5095

5196
- name: Install Bun
5297
uses: oven-sh/setup-bun@v1
@@ -59,10 +104,13 @@ jobs:
59104
- uses: tauri-apps/tauri-action@v0
60105
env:
61106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
108+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
62109
with:
63110
tagName: content-manager-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
64111
releaseName: "Content Manager v__VERSION__"
65112
releaseBody: "See the assets to download this version and install."
66113
releaseDraft: true
67114
prerelease: false
68115
args: ${{ matrix.args }}
116+
body: ${{ needs.changelog.outputs.release_body }}

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[![animation](https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/img/git-cliff-anim.gif)](https://git-cliff.org)
2+
3+
## [0.4.1](https://github.com/bartosz-skejcik/content-planner/compare/content-manager-v0.4.0..v0.4.1) - 2024-11-21
4+
5+
### ✨ Features
6+
7+
- Auto-updating - ([2da8a33](https://github.com/bartosz-skejcik/content-planner/commit/2da8a333d6546f2a06d64dbf11b0d0efa4a98718))
8+
- Move to bun - ([b69d8f6](https://github.com/bartosz-skejcik/content-planner/commit/b69d8f65a12ca2e73961b5167272aab974582667))
9+
- Move to bun - ([8e5c0d7](https://github.com/bartosz-skejcik/content-planner/commit/8e5c0d7bdf625853f26c67475538c4e3b4c52a97))
10+
- Move to bun - ([950a3ae](https://github.com/bartosz-skejcik/content-planner/commit/950a3ae33c0409f48cdb0ce3def7fddcaabe2bb4))
11+
- Idea create & update functionality - ([aa7172b](https://github.com/bartosz-skejcik/content-planner/commit/aa7172b6dd61c1bfe618b315ae383605e0b39f7e))
12+
- Idea search&filter && adding to favorites - ([04cf529](https://github.com/bartosz-skejcik/content-planner/commit/04cf52978f52b172a8d3d64b3196ccba11f7e6f5))
13+
- Schedule page and sidebar tweaks - ([780320d](https://github.com/bartosz-skejcik/content-planner/commit/780320d15f64ac9eef7c173c34c85a0e1330e9b6))
14+
- Basic calendar view - ([4f14d56](https://github.com/bartosz-skejcik/content-planner/commit/4f14d56ef15115a16c98200244de3582894d3c20))
15+
- Logos - ([863e531](https://github.com/bartosz-skejcik/content-planner/commit/863e5315269204d546ff9f3433d9166b380d16d1))
16+
17+
### 🐛 Bug Fixes
18+
19+
- Sqlite instead of json && idea bank prototype - ([b308172](https://github.com/bartosz-skejcik/content-planner/commit/b3081728a0c5313fa593a387a097c203f4122b8a))
20+
- Sqlite instead of json && idea bank prototype - ([3704306](https://github.com/bartosz-skejcik/content-planner/commit/37043069df693e26ccf89788e83441f28e73dfde))
21+
- Sqlite instead of json && idea bank prototype - ([2404685](https://github.com/bartosz-skejcik/content-planner/commit/2404685285d906406a151995d82beeb2e0f41426))
22+
- Sqlite instead of json && idea bank prototype - ([99bac0a](https://github.com/bartosz-skejcik/content-planner/commit/99bac0a220d7e82d5479311eed57f101cca9019f))
23+
24+
### 📖 Documentation Updates
25+
26+
- *(changelog)* Add changelog - ([538e81f](https://github.com/bartosz-skejcik/content-planner/commit/538e81f85559e46682cc66fe5e83300d279ec5ef))
27+
- *(cliff)* Add cliff.toml file for changelog generation - ([1dd4f7b](https://github.com/bartosz-skejcik/content-planner/commit/1dd4f7bad2d5879f6bb59adcb42f15198a5e034d))
28+
29+
### 🏗️ Build/CI
30+
31+
- Add github actions for changelog generation - ([b2a18ed](https://github.com/bartosz-skejcik/content-planner/commit/b2a18edae1a0dd961b46bca036e351d5d0898ea7))
32+
33+
### Hotfix
34+
35+
- *(ci)* Fix release workflow - ([988c893](https://github.com/bartosz-skejcik/content-planner/commit/988c8931b90cc6b96a2966cc00e30af2527ed490))
36+
- Workflow - ([d0dbef1](https://github.com/bartosz-skejcik/content-planner/commit/d0dbef127e643a311eb6c6248226bacba68bafb7))
37+
38+
### Update
39+
40+
- Readme.md - ([64d8157](https://github.com/bartosz-skejcik/content-planner/commit/64d815756a38751bf830799f5baf17d381a100fb))
41+
42+
## New Contributors ❤️
43+
44+
* @bartosz-skejcik made their first contribution in [#10](https://github.com/bartosz-skejcik/content-planner/pull/10)
45+
46+
<!-- generated by git-cliff -->

bun.lockb

849 Bytes
Binary file not shown.

cliff.toml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
#
4+
# Lines starting with "#" are comments.
5+
# Configuration options are organized into tables and keys.
6+
# See documentation for more information on available options.
7+
8+
[remote.github]
9+
owner = "bartosz-skejcik"
10+
repo = "content-planner"
11+
12+
[changelog]
13+
# template for the changelog header
14+
header = """
15+
[![animation](https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/img/git-cliff-anim.gif)](https://git-cliff.org)\n
16+
"""
17+
# template for the changelog body
18+
# https://keats.github.io/tera/docs/#introduction
19+
body = """
20+
{%- macro remote_url() -%}
21+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
22+
{%- endmacro -%}
23+
24+
{% macro print_commit(commit) -%}
25+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
26+
{% if commit.breaking %}[**breaking**] {% endif %}\
27+
{{ commit.message | upper_first }} - \
28+
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
29+
{% endmacro -%}
30+
31+
{% if version %}\
32+
{% if previous.version %}\
33+
## [{{ version | trim_start_matches(pat="v") }}]\
34+
({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
35+
{% else %}\
36+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
37+
{% endif %}\
38+
{% else %}\
39+
## [unreleased]
40+
{% endif %}\
41+
42+
{% for group, commits in commits | group_by(attribute="group") %}
43+
### {{ group | striptags | trim | upper_first }}
44+
{% for commit in commits
45+
| filter(attribute="scope")
46+
| sort(attribute="scope") %}
47+
{{ self::print_commit(commit=commit) }}
48+
{%- endfor %}
49+
{% for commit in commits %}
50+
{%- if not commit.scope -%}
51+
{{ self::print_commit(commit=commit) }}
52+
{% endif -%}
53+
{% endfor -%}
54+
{% endfor -%}
55+
{%- if github -%}
56+
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
57+
## New Contributors ❤️
58+
{% endif %}\
59+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
60+
* @{{ contributor.username }} made their first contribution
61+
{%- if contributor.pr_number %} in \
62+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
63+
{%- endif %}
64+
{%- endfor -%}
65+
{%- endif %}
66+
67+
68+
"""
69+
# template for the changelog footer
70+
footer = """
71+
<!-- generated by git-cliff -->
72+
"""
73+
# remove the leading and trailing whitespace from the templates
74+
trim = true
75+
# postprocessors
76+
postprocessors = [
77+
{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
78+
]
79+
80+
[git]
81+
# parse the commits based on https://www.conventionalcommits.org
82+
conventional_commits = true
83+
# filter out the commits that are not conventional
84+
filter_unconventional = true
85+
# process each line of a commit as an individual commit
86+
split_commits = false
87+
# regex for preprocessing the commit messages
88+
commit_preprocessors = [
89+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
90+
# Check spelling of the commit with https://github.com/crate-ci/typos
91+
# If the spelling is incorrect, it will be automatically fixed.
92+
{ pattern = '.*', replace_command = 'typos --write-changes -' },
93+
]
94+
# regex for parsing and grouping commits
95+
commit_parsers = [
96+
{ message = "^feat", group = "<!-- 0 -->✨ Features" },
97+
{ message = "^add", group = "<!-- 0 -->✨ Features" },
98+
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
99+
{ message = "^refactor", group = "<!-- 2 -->♻️ Refactors" },
100+
{ message = "^perf", group = "<!-- 3 -->⚡ Performance Improvements" },
101+
{ message = "^style", group = "<!-- 4 -->💄 Style Changes" },
102+
{ message = "^doc", group = "<!-- 5 -->📖 Documentation Updates" },
103+
{ message = "^test", group = "<!-- 6 -->✅ Testing" },
104+
{ message = "^build", group = "<!-- 7 -->🏗️ Build/CI" },
105+
{ message = "^ci", group = "<!-- 7 -->🏗️ Build/CI" },
106+
{ message = "^deprecate", group = "<!-- 8 -->🗑️ Deprecations" },
107+
{ body = ".*security", group = "<!-- 9 -->🔒 Security" },
108+
{ message = "^breaking", group = "<!-- 10 -->💥 Breaking Changes" },
109+
{ message = "^revert", group = "<!-- 11 -->◀️ Reverts" },
110+
{ message = "^chore", group = "<!-- 12 -->⚙️ Miscellaneous Tasks" },
111+
112+
# Skipped messages
113+
{ message = "^refactor\\(clippy\\)", skip = true },
114+
{ message = "^chore\\(release\\): prepare for", skip = true },
115+
{ message = "^chore\\(deps.*\\)", skip = true },
116+
{ message = "^chore\\(pr\\)", skip = true },
117+
{ message = "^chore\\(pull\\)", skip = true },
118+
{ message = "^chore\\(npm\\).*yarn\\.lock", skip = true },
119+
]
120+
121+
# protect breaking changes from being skipped due to matching a skipping commit_parser
122+
protect_breaking_commits = true
123+
# filter out the commits that are not matched by commit parsers
124+
filter_commits = false
125+
# regex for matching git tags
126+
tag_pattern = "v[0-9].[0-9].*"
127+
# regex for skipping tags
128+
skip_tags = "beta|alpha"
129+
# regex for ignoring tags
130+
ignore_tags = "rc|v2.1.0|v2.1.1"
131+
# sort the tags topologically
132+
topo_order = false
133+
# sort the commits inside sections by oldest/newest order
134+
sort_commits = "newest"

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "content-planner",
33
"private": true,
4-
"version": "0.4.0",
4+
"version": "0.4.1",
55
"type": "module",
66
"scripts": {
77
"dev:tauri": "tauri dev",
@@ -24,9 +24,11 @@
2424
"@radix-ui/react-toggle": "^1.1.0",
2525
"@radix-ui/react-tooltip": "^1.1.3",
2626
"@tauri-apps/api": "^2",
27+
"@tauri-apps/plugin-dialog": "^2.0.1",
2728
"@tauri-apps/plugin-shell": "^2",
2829
"@tauri-apps/plugin-sql": "~2",
2930
"@tauri-apps/plugin-store": "^2.1.0",
31+
"@tauri-apps/plugin-updater": "^2.0.0",
3032
"bun-types": "^1.1.34",
3133
"class-variance-authority": "^0.7.0",
3234
"clsx": "^2.1.1",

0 commit comments

Comments
 (0)