diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d40c42a..5a03416 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d3d9f5..4e75c5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cliff.toml b/cliff.toml index 801ccd5..e48eb5d 100644 --- a/cliff.toml +++ b/cliff.toml @@ -91,7 +91,7 @@ commit_preprocessors = [ { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/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 = [ @@ -103,6 +103,8 @@ commit_parsers = [ { message = "^style", group = "🎨 Styling" }, { message = "^test", group = "🧪 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 },