Skip to content

Commit

Permalink
chore: Add recipes to assist in releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysparry committed Dec 7, 2024
1 parent 831185f commit acc6055
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ filter_unconventional = true
split_commits = false
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^chore.release.: release", skip = true },
{ message = "^.*: [Aa]dd", group = "Added" },
{ message = "^.*: [Ss]upport", group = "Added" },
{ message = "^.*: [Rr]emove", group = "Removed" },
Expand Down
28 changes: 28 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,31 @@ release-notes: artifacts-dir

changelog:
git-cliff --output CHANGELOG.md

[windows, private]
assert-branch name="main":
@if ((git branch --show-current) -ne "{{ name }}") { throw "Not on {{ name }} branch" }

[unix, private]
assert-branch name="main":
[ "$(git branch --show-current)" = "{{ name }}" ]

[windows, private]
assert-no-pending-changes:
@if ($null -ne (git status --porcelain)) { throw "There are pending changes" }

[unix, private]
assert-no-pending-changes:
[ -z "$(git status --porcelain)" ]

release: (assert-branch "main") assert-no-pending-changes && push-release
git pull
git-cliff --bump --output CHANGELOG.md
git-cliff --bump --unreleased --strip header --output artifacts/RELEASE-NOTES.md
git add CHANGELOG.md
git commit -m "chore(release): release {{ Version }}"
git tag "v{{ Version }}" -F artifacts/RELEASE-NOTES.md --cleanup=whitespace

[private, confirm("Are you sure you want to push the release?")]
push-release:
git push origin main --tags

0 comments on commit acc6055

Please sign in to comment.