Skip to content

Commit

Permalink
ci: release automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Aug 24, 2024
1 parent 45fcc6a commit abafc23
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 4 deletions.
52 changes: 49 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,56 @@ on:
- "v*.*.*"

jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Tag Version
id: tag_version
run: echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Generate Full Changelog
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Commit Changelog
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git switch main
git add CHANGELOG.md
git commit -m "chore(release-bot): prepare for release notes on ${CURRENT_TAG}"
git push
release:
runs-on: ubuntu-latest
needs: changelog
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v2
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate Latest Release Notes
id: latest_release_notes
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --latest --strip all
env:
OUTPUT: CHANGELOG.txt

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
body_path: CHANGELOG.txt
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@

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

## [1.1.5](https://github.com/x-pt/template/compare/v1.1.4..v1.1.5) - 2024-08-24

### ⚙️ Miscellaneous Tasks

- Fix the push action error - ([674b069](https://github.com/x-pt/template/commit/674b06999e23bc482c6e5cfd53612182c3c167da))


## [1.1.4](https://github.com/x-pt/template/compare/v1.1.3..v1.1.4) - 2024-08-24

### ⚙️ Miscellaneous Tasks

- Fix the push action error - ([660564d](https://github.com/x-pt/template/commit/660564db7d1c42d93a1ea12ea37665581ba2f1b1))


## [1.1.3](https://github.com/x-pt/template/compare/v1.1.2..v1.1.3) - 2024-08-24

### ⚙️ Miscellaneous Tasks

- Fix the push action error - ([12e3080](https://github.com/x-pt/template/commit/12e30801505dcf7c42cc5521ac2fb6910f8582d2))


## [1.1.2](https://github.com/x-pt/template/compare/v1.1.1..v1.1.2) - 2024-08-24

### ⚙️ Miscellaneous Tasks

- Update the release action - ([fefa8b6](https://github.com/x-pt/template/commit/fefa8b6d3ef603549c1dcbea84bdc5a187d3d51e))


## [1.1.1](https://github.com/x-pt/template/compare/v1.1.0..v1.1.1) - 2024-08-24

### ⚙️ Miscellaneous Tasks

- Only show the latest release notes - ([1233bc1](https://github.com/x-pt/template/commit/1233bc1ce81da23cf1dff467d73ecda99a5d22df))


## [1.1.0](https://github.com/x-pt/template/compare/v1.0.0..v1.1.0) - 2024-08-24

### 🚀 Features
Expand Down
4 changes: 3 additions & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
# Check spelling of the commit with https://github.com/crate-ci/typos
# If the spelling is incorrect, it will be automatically fixed.
{ pattern = '.*', replace_command = 'typos --write-changes -' },
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
]
# regex for parsing and grouping commits
commit_parsers = [
Expand All @@ -103,6 +103,8 @@ commit_parsers = [
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(release-bot\\): prepare for", skip = true },
{ message = "^chore: bump version to", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
Expand Down

0 comments on commit abafc23

Please sign in to comment.