-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bump): support bumping based on configurable custom pattern (#725)
* chore(deps): bump next_version from 0.2.17 to 0.2.18 Bumps [next_version](https://github.com/MarcoIeni/release-plz) from 0.2.17 to 0.2.18. - [Release notes](https://github.com/MarcoIeni/release-plz/releases) - [Changelog](https://github.com/MarcoIeni/release-plz/blob/main/CHANGELOG.md) - [Commits](release-plz/release-plz@next_version-v0.2.17...next_version-v0.2.18) --- updated-dependencies: - dependency-name: next_version dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * feat: Support bumping version based on configurable custom pattern closes #717 * refactor: clean up implementation --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Orhun Parmaksız <[email protected]>
- Loading branch information
1 parent
d642d33
commit 8e03356
Showing
9 changed files
with
172 additions
and
17 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
.github/fixtures/test-bump-version-custom-minor/cliff.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[changelog] | ||
# template for the changelog footer | ||
header = """ | ||
# Changelog\n | ||
All notable changes to this project will be documented in this file.\n | ||
""" | ||
# template for the changelog body | ||
# https://keats.github.io/tera/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | upper_first }} | ||
{% for commit in commits %} | ||
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
# template for the changelog footer | ||
footer = """ | ||
<!-- generated by git-cliff --> | ||
""" | ||
# remove the leading and trailing whitespace from the templates | ||
trim = true | ||
|
||
[bump] | ||
features_always_bump_minor = true | ||
breaking_always_bump_major = true | ||
custom_minor_increment_regex = "minor|more" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
GIT_COMMITTER_DATE="2021-01-23 01:23:45" git commit --allow-empty -m "feat: add feature 1" | ||
GIT_COMMITTER_DATE="2021-01-23 01:23:45" git commit --allow-empty -m "feat: add feature 2" | ||
git tag v0.1.0 | ||
|
||
GIT_COMMITTER_DATE="2021-01-23 01:23:46" git commit --allow-empty -m "minor: add minor" | ||
GIT_COMMITTER_DATE="2021-01-23 01:23:46" git commit --allow-empty -m "fix: fix feature 2" |
22 changes: 22 additions & 0 deletions
22
.github/fixtures/test-bump-version-custom-minor/expected.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
## [0.2.0] | ||
|
||
### Fix | ||
|
||
- Fix feature 2 | ||
|
||
### Minor | ||
|
||
- Add minor | ||
|
||
## [0.1.0] | ||
|
||
### Feat | ||
|
||
- Add feature 1 | ||
- Add feature 2 | ||
|
||
<!-- generated by git-cliff --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters