Skip to content

Commit

Permalink
chore(dev): add git-chglog configuration, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
vst committed Feb 8, 2021
1 parent 9a755c4 commit a2a78ca
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# CHANGELOG

All notable changes to this project will be documented in this file.
This project adheres to [Haskell Package Versioning
Policy](https://pvp.haskell.org/).

{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
36 changes: 36 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/telostat/habulara
options:
commits:
filters:
Type:
- feat
- fix
- perf
- docs
- refactor
commit_groups:
sort_by: Custom
title_order:
- feat
- fix
- perf
- docs
- refactor
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,36 @@ Copyright Telostat Pte Ltd (c) 2020-2021.

This work is licensed under BSD3. Please check the license file
included in the source-code.

## Development

### Releasing

```
git checkout main
git merge --no-ff develop
export TAG_IN_RELEASE="0.0.0.3"
git-chglog --next-tag "${TAG_IN_RELEASE}" -o ChangeLog.md
git commit -am "chore(release): ${TAG_IN_RELEASE}"
git tag -a -m "Release ${TAG_IN_RELEASE}" "${TAG_IN_RELEASE}"
git push --follow-tags origin main
```

Then, create a new release on GitHub and upload the `.tar.gz` and `habulara-Linux-x86_64` files generated by:

```
stack sdist
stack install
cp "$(which habulara)" habulara-Linux-x86_64
upx habulara-Linux-x86_64
```

Finally, checkout to develop and bump the version:

```
git checkout develop
export TAG_IN_DEVELOPMENT="0.0.0.4"
## Edit package.yaml and then:
git commit -am "chore: bump development version to ${TAG_IN_DEVELOPMENT}"
git push
```

0 comments on commit a2a78ca

Please sign in to comment.