Skip to content

Commit abafc23

Browse files
committed
ci: release automatically
1 parent 45fcc6a commit abafc23

File tree

3 files changed

+87
-4
lines changed

3 files changed

+87
-4
lines changed

.github/workflows/release.yml

+49-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,56 @@ on:
66
- "v*.*.*"
77

88
jobs:
9+
changelog:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Get Tag Version
18+
id: tag_version
19+
run: echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
20+
21+
- name: Generate Full Changelog
22+
uses: orhun/git-cliff-action@v3
23+
with:
24+
config: cliff.toml
25+
args: --verbose
26+
env:
27+
OUTPUT: CHANGELOG.md
28+
GITHUB_REPO: ${{ github.repository }}
29+
30+
- name: Commit Changelog
31+
run: |
32+
git config user.name 'github-actions[bot]'
33+
git config user.email 'github-actions[bot]@users.noreply.github.com'
34+
set +e
35+
git switch main
36+
git add CHANGELOG.md
37+
git commit -m "chore(release-bot): prepare for release notes on ${CURRENT_TAG}"
38+
git push
39+
940
release:
1041
runs-on: ubuntu-latest
42+
needs: changelog
1143
steps:
12-
- uses: actions/checkout@v4
13-
- uses: softprops/action-gh-release@v2
44+
- name: Checkout Code
45+
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0
48+
49+
- name: Generate Latest Release Notes
50+
id: latest_release_notes
51+
uses: orhun/git-cliff-action@v3
52+
with:
53+
config: cliff.toml
54+
args: --latest --strip all
55+
env:
56+
OUTPUT: CHANGELOG.txt
57+
58+
- name: Create GitHub Release
59+
uses: softprops/action-gh-release@v2
1460
with:
15-
body_path: CHANGELOG.md
61+
body_path: CHANGELOG.txt

CHANGELOG.md

+35
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,41 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.1.5](https://github.com/x-pt/template/compare/v1.1.4..v1.1.5) - 2024-08-24
6+
7+
### ⚙️ Miscellaneous Tasks
8+
9+
- Fix the push action error - ([674b069](https://github.com/x-pt/template/commit/674b06999e23bc482c6e5cfd53612182c3c167da))
10+
11+
12+
## [1.1.4](https://github.com/x-pt/template/compare/v1.1.3..v1.1.4) - 2024-08-24
13+
14+
### ⚙️ Miscellaneous Tasks
15+
16+
- Fix the push action error - ([660564d](https://github.com/x-pt/template/commit/660564db7d1c42d93a1ea12ea37665581ba2f1b1))
17+
18+
19+
## [1.1.3](https://github.com/x-pt/template/compare/v1.1.2..v1.1.3) - 2024-08-24
20+
21+
### ⚙️ Miscellaneous Tasks
22+
23+
- Fix the push action error - ([12e3080](https://github.com/x-pt/template/commit/12e30801505dcf7c42cc5521ac2fb6910f8582d2))
24+
25+
26+
## [1.1.2](https://github.com/x-pt/template/compare/v1.1.1..v1.1.2) - 2024-08-24
27+
28+
### ⚙️ Miscellaneous Tasks
29+
30+
- Update the release action - ([fefa8b6](https://github.com/x-pt/template/commit/fefa8b6d3ef603549c1dcbea84bdc5a187d3d51e))
31+
32+
33+
## [1.1.1](https://github.com/x-pt/template/compare/v1.1.0..v1.1.1) - 2024-08-24
34+
35+
### ⚙️ Miscellaneous Tasks
36+
37+
- Only show the latest release notes - ([1233bc1](https://github.com/x-pt/template/commit/1233bc1ce81da23cf1dff467d73ecda99a5d22df))
38+
39+
540
## [1.1.0](https://github.com/x-pt/template/compare/v1.0.0..v1.1.0) - 2024-08-24
641

742
### 🚀 Features

cliff.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ commit_preprocessors = [
9191
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
9292
# Check spelling of the commit with https://github.com/crate-ci/typos
9393
# If the spelling is incorrect, it will be automatically fixed.
94-
{ pattern = '.*', replace_command = 'typos --write-changes -' },
94+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
9595
]
9696
# regex for parsing and grouping commits
9797
commit_parsers = [
@@ -103,6 +103,8 @@ commit_parsers = [
103103
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
104104
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
105105
{ message = "^chore\\(release\\): prepare for", skip = true },
106+
{ message = "^chore\\(release-bot\\): prepare for", skip = true },
107+
{ message = "^chore: bump version to", skip = true },
106108
{ message = "^chore\\(deps.*\\)", skip = true },
107109
{ message = "^chore\\(pr\\)", skip = true },
108110
{ message = "^chore\\(pull\\)", skip = true },

0 commit comments

Comments
 (0)