Skip to content

Latest commit

Β 

History

History
527 lines (439 loc) Β· 19.2 KB

File metadata and controls

527 lines (439 loc) Β· 19.2 KB

Changelog

The changelog section is common to all releasers. The reference shows the use of github but you may substitute it with the appropriate releaser of your choice.

YAML
# [exclamation triangle]
release:
  # Repo in which the release will be created.
  # [exclamation triangle]
  github:

partial$release/yaml/changelog.adoc
TOML
# Repo in which the release will be created.
# [exclamation triangle]
[release.github]

partial$release/toml/changelog.adoc
JSON
{
  // [exclamation triangle]
  "release": {
    // Repo in which the release will be created.
    // [exclamation triangle]
    "github": {

partial$release/json/changelog.adoc
partial$release/json/common-footer.adoc
Maven
<jreleaser>
  <!--
    [exclamation triangle]
  -->
  <release>
    <!--
      Repo in which the release will be created.
      [exclamation triangle]
    -->
    <github>

partial$release/maven/changelog.adoc
partial$release/maven/common-footer.adoc
Gradle
jreleaser {
  // [exclamation triangle]
  release {
    // Repo in which the release will be created.
    // [exclamation triangle]
    github {

partial$release/gradle/changelog.adoc
partial$release/gradle/common-footer.adoc

You may define either content or contentTemplate, with the latter taking precedence over the former.

Changelog formatting applies only to the automatically generated changelog, that is, formatting won’t occur if the external property is set. Format applies only to local commits at the moment, the use of labelers is highly encouraged.

The changelog.format property only accepts the following name templates:

Key Description

commitShortHash

head commit hash abbreviated to 7 characters

commitFullHash

head commit hash

commitTitle

first line of the commit message

commitAuthor

full name of the commit author

commitsUrl

commits URl as provided by the Git host

The content and contentTemplate accept all reference:name-templates.adoc, take special consideration on {{changelogChanges}} and {{changelogContributors}} as they define the parsed commits.

If you want to omit merge commits in the changelog, use skipMergeCommits property. If not set, defaults to {{false}}.

Templates

The default location for templates is:

src/jreleaser/templates

The following list shows the filenames that may be used to override default templates:

  • changelog.tpl

Commits

If you wish to generate the changelog between two tags, with tags in between, you may configure previousTagName. It generates the changelog based on all commits between the two tags. (git log <previousTagName>…​<tagName>).

If not defined, it will default to the logical previous tag of the defined tagName.

Contributors

Contributor names are added to the formatted changelog by default. You may choose to provide a custom format or disable this behavior completely. The contributors.format property accepts the following templates:

Key Description

contributorName

the contributor’s name as plain text

contributorNameAsLink

the contributor’s name as a link

contributorUsername

the contributor’s username as plain text

contributorUsernameAsLink

the contributor’s username as a link

The use of {{contributorNameAsLink}}, {{contributorUsername}}, or {{contributorUsernameAsLink}} incurs on a network call to the remote service to find out information related to the given contributor.

Note
Use a - or * character as prefix in format to list each contributor on its own row.

The following configuration

release:
  github:
    username: aalmiray
    overwrite: true
    draft: false
    sign: true
    changelog:
      formatted: ALWAYS
      format: '- {{commitShortHash}} {{commitTitle}}'
      labelers:
        - label: 'feature'
          title: 'Resolves #'
          body: 'Resolves #'
        - label: 'issue'
          title: 'Fixes #'
          body: 'Fixes #'
        - label: 'issue'
          title: 'Relates to #'
          body: 'Relates to #'
        - label: 'task'
          title: '[chore]'
      categories:
        - title: 'πŸš€ Features'
          key: 'features'
          labels:
            - 'feature'
        - title: 'βœ… Issues'
          key: 'issues'
          labels:
            - 'issue'
        - title: '🧰 Tasks'
          key: 'tasks'
          labels:
            - 'task'
      replacers:
        - search: '\[chore\] '

Generates a changelog similar to

ROOT:jreleaser changelog render

Order

Both labelers and categories will be ordered based on their declared location however you may change this order by explicitly setting a value for their order property. The lower the number the higher the priority. The value of the order property must be unique.

Presets

Presets define conventions applicable to:

  • labelers

  • categories

  • replacers

  • hide

    • categories

    • contributors

You may apply a preset while at the same time define additional elements. Your configuration takes precedence over the preset’s, allowing you to add/merge. For the time being you can’t remove a setting defined by a preset.

Conventional Commits

Commit messages that follow the Conventional Commits specification will be automatically labeled and categorized. The following table shows mappings that you may use when this preset is applied:

Category Key Order Label Prefix Order

πŸ”€ Merge

merge

0

merge

Merge pull

0

πŸ”€ Merge

merge

0

merge

Merge branch

5

πŸš€ Features

features

10

feat

feat:

50

πŸ› Fixes

fixes

20

fix

fix:

60

πŸ”„ Changes

changes

30

perf

perf:

70

πŸ”„ Changes

changes

30

refactor

refactor:

80

πŸ”„ Changes

changes

30

revert

revert:

90

πŸ”„ Changes

changes

30

style

style:

100

🧰 Tasks

tasks

40

chore

chore:

20

πŸ›  Build

build

50

test

test:

110

πŸ›  Build

build

50

build

build:

10

πŸ›  Build

build

50

ci

ci:

30

πŸ“ Documentation

docs

60

docs

docs:

40

You may define an optional scope as part of the prefix, such as fix(core) or feat(plugins). A ! in the prefix will be replaced with a 🚨 emoji. All prefixes will be removed except for their scope. The following commits

feat: Add download urls
fix: Fix typos
fix(core): Add missing checks in loader
fix(engine)!: Plugins require custom classloader

Will be rendered as

## Features

3adf1b5 Add download urls

## Fixes

47e2a81 Fix typos
ea65d99 (core) Add missing checks in loader
8ac258c 🚨 (engine) Plugins require custom classloader
Note
Use the key value to match a category and change its settings.

Example

The following configuration

release:
  github:
    changelog:
      formatted: ALWAYS
      preset: 'conventional-commits'
      format: '- {{commitShortHash}} {{commitTitle}}'

For a project with the following commits

* bda315f (HEAD -> main, upstream/main) docs: Add missing "`". (#1048)
* 3adf1b5 fix: Do not force .java suffix for Quarkus based templates (#1039)
* 013f328 feat: Startup scripts now use User-Agent header for downloads (#1037)
* 47e2a81 fix: This fixes extraneous jbang.cmd output (#1041)
* fe08627 refactor: Simplified `jbang.cmd` (#1038)
* ea65d99 fix: add hint to user they can get updated catalog using --fresh (#1040)
* 8ac258c fix: No longer pass Accept header (#1036)
* 95a715e [patch] fix linux based java download
* 275d31a fix: archive type for foojay. Fixes #1035
* d42951d [patch]
* 98866f1 fix: Add itest for issue #1019 (#1033)
* 20514c7 fix: Now really fixed updating on Windows (#1031)
* 9ed4116 [minor]
* fb45502 chore: use jreleaser 0.7
* 7419590 fix: edit now honors JBANG_EDITOR again
* 3955647 fix: Not checking for new version on first run anymore (#1023)
* 5e16e22 fix:  jbang edit suggests incorrect command when template renames out… (#1020)
* 3ac5561 fix: --deps now gets special javafx treatments as //DEPS does (#1017)
* 52b2377 fix: Fixed link to "Usage on Windows" (#1026)
* 8d5ea6a fix: Fixed download URL in `jbang` script (#1021)
* b750ebb fix: kotlin edit now link to source rather than cache location (#1015)
* 6f87c70 chore: eliminate warnings from code base (#1011)
* f842666 docs: Update spotless pre-commit hook url (#1009)
* d297667 [patch] fix java 17 downloads
* f6a32db fix: use termurin for java 17
* 43b2c72 chore: remove j'bang from choco name, its just JBang
* da0c971 fix: proper nuget
* 30cf637 (tag: v0.80.1) [patch]

Generates a changelog similar to

ROOT:jreleaser changelog preset conventional commits

Gitmoji

Commit messages that follow the Gitmoji convention will be automatically labeled and categorized. The following table shows mappings that you may use when this preset is applied:

Category Key Order Label Emoji Keyword

πŸ”€ Merge

merge

0

merge

πŸ”€

πŸ”€

πŸš€ Added

added

10

added

✨

✨

πŸš€ Added

added

10

added

πŸŽ‰

πŸŽ‰

πŸš€ Added

added

10

added

βœ…

βœ…

πŸš€ Added

added

10

added

πŸ‘·

πŸ‘·

πŸš€ Added

added

10

added

πŸ“ˆ

πŸ“ˆ

πŸš€ Added

added

10

added

βž•

βž•

πŸš€ Added

added

10

added

πŸ”Š

πŸ”Š

πŸ”„οΈ Changed

changed

20

changed

🎨

🎨

πŸ”„οΈ Changed

changed

20

changed

⚑️

⚑

πŸ”„οΈ Changed

changed

20

changed

πŸ’„

πŸ’„

πŸ”„οΈ Changed

changed

20

changed

🚨

🚨

πŸ”„οΈ Changed

changed

20

changed

πŸ“Œ

πŸ“Œ

πŸ”„οΈ Changed

changed

20

changed

♻️

♻️

πŸ”„οΈ Changed

changed

20

changed

πŸ”§

πŸ”§

πŸ”„οΈ Changed

changed

20

changed

πŸ”¨

πŸ”¨

πŸ”„οΈ Changed

changed

20

changed

βͺ

βͺ

πŸ”„οΈ Changed

changed

20

changed

πŸ‘½

πŸ‘½

πŸ”„οΈ Changed

changed

20

changed

🚚

🚚

πŸ”„οΈ Changed

changed

20

changed

🍱

🍱

πŸ”„οΈ Changed

changed

20

changed

♿️

β™Ώ

πŸ”„οΈ Changed

changed

20

changed

πŸ’¬

πŸ’¬

πŸ”„οΈ Changed

changed

20

changed

πŸ—ƒ

πŸ—ƒοΈ

πŸ”„οΈ Changed

changed

20

changed

🚸

🚸

πŸ”„οΈ Changed

changed

20

changed

πŸ—

πŸ—οΈ

πŸ”„οΈ Changed

changed

20

changed

πŸ“±

πŸ“±

πŸ”„οΈ Changed

changed

20

changed

πŸ“¦

πŸ“¦

🚨 Breaking

breaking

30

breaking_changes

πŸ’₯

πŸ’₯

πŸ’₯ Deprecated

deprecated

40

deprecated

πŸ—‘

πŸ—‘οΈ

πŸ—‘ Removed

removed

50

Removed

βž–

βž–

πŸ—‘ Removed

removed

50

Removed

πŸ”₯

πŸ”₯

πŸ—‘ Removed

removed

50

Removed

πŸ”‡

πŸ”‡

πŸ—‘ Removed

removed

50

Removed

⚰️

⚰️

πŸ› Fixed

fixed

60

fixed

πŸ›

πŸ›

πŸ› Fixed

fixed

60

fixed

πŸš‘

πŸš‘

πŸ› Fixed

fixed

60

fixed

🍎

🍎

πŸ› Fixed

fixed

60

fixed

🍏

🍏

πŸ› Fixed

fixed

60

fixed

🐧

🐧

πŸ› Fixed

fixed

60

fixed

🏁

🏁

πŸ› Fixed

fixed

60

fixed

πŸ€–

πŸ€–

πŸ› Fixed

fixed

60

fixed

πŸ’š

πŸ’š

πŸ› Fixed

fixed

60

fixed

✏️

✏️

πŸ› Fixed

fixed

60

fixed

🩹️

🩹

πŸ”’οΈ Security

security

70

security

πŸ”’οΈ

πŸ”’

πŸ”’οΈ Security

security

70

security

πŸ›‚

πŸ›‚

πŸ“¦ Dependencies

deps

80

dependencies

⬆️

⬆️

πŸ“¦ Dependencies

deps

80

dependencies

⬇️

⬇️

πŸ“ Documentation

docs

90

documentation

πŸ“

πŸ“

πŸ“ Documentation

docs

90

documentation

πŸ“

πŸ“

πŸ“ Documentation

docs

90

documentation

🌐

🌐

πŸ“ Documentation

docs

90

documentation

πŸ“„

πŸ“„

πŸ“ Documentation

docs

90

documentation

πŸ’‘

πŸ’‘

🎲 Miscellaneous

misc

100

misc

πŸ’©

πŸ’©

🎲 Miscellaneous

misc

100

misc

🚧

🚧

🎲 Miscellaneous

misc

100

misc

🍻

🍻

🎲 Miscellaneous

misc

100

misc

πŸ‘₯

πŸ‘₯

🎲 Miscellaneous

misc

100

misc

🀑

🀑

🎲 Miscellaneous

misc

100

misc

πŸ₯š

πŸ₯š

🎲 Miscellaneous

misc

100

misc

πŸ™ˆ

πŸ™ˆ

🎲 Miscellaneous

misc

100

misc

πŸ“Έ

πŸ“Έ

🎲 Miscellaneous

misc

100

misc

βš—οΈ

βš—οΈ

🎲 Miscellaneous

misc

100

misc

πŸ”

πŸ”

🎲 Miscellaneous

misc

100

misc

πŸ₯…

πŸ₯…

🎲 Miscellaneous

misc

100

misc

🧐

🧐

🎲 Miscellaneous

misc

100

misc

πŸ§ͺ

πŸ§ͺ

🎲 Miscellaneous

misc

100

misc

πŸ‘”

πŸ‘”

🎲 Miscellaneous

misc

100

misc

πŸ‘Œ

πŸ‘Œ

🏁 Release

release

110

release

πŸš€

πŸš€

🏁 Release

release

110

release

πŸ”–

πŸ”–

The following commit messages are equivalent:

πŸ› Random number generator always returns 4.
:bug: Random number generator always returns 4.

Keywords are automatically replaced by their corresponding emoji in the generated changelog.

Note
Use the key value to match a category and change its settings.

Example

The following configuration

release:
  github:
    changelog:
      formatted: ALWAYS
      preset: 'gitmoji'
      format: '- {{commitShortHash}} {{commitTitle}}'

For a project with the following commits

* 3dabd57 :bookmark: Release v2.2.0
* a9b1bfe :bug: Fix init command (#204)
* cdf76f9 :pushpin: Upgrade dependencies (#191)
* f7ca721 :memo: Fix the link and update year (#197)
* ceab8dc :sparkles: Add Cargo preset (#199)
* d2ee43d :memo: Change documentation link in README (#196)
* e06e08d :busts_in_silhouette: Add endormi as a contributor (#195)
* 5e0a971 :docs: Add the documentation site (#194)
* 20cf369 :bug: Fix a bug occuring when version is missing in configuration but passed as argument (#190)
* b12dfec :ok_hand: Take care of review
* 9a15406 :goal_net: Handle functional errors
* 4e22239 :pencil: Improve documentation about presets (#189)
* 1febf42 :wrench: Update lock file
* 1635963 :memo: Improve Workflow section (#152)
* a127469 :arrow_up: Upgrade dependencies

Generates a changelog similar to

ROOT:jreleaser changelog preset gitmoji

Appending

JReleaser may append the changelog for a given release to an existing changelog (typically CHANGELOG.md at the root of the project). This can be achieved by enabling the append block, for example

release:
  github:
    changelog:
      formatted: always
      categoryTitleFormat: '#### {{categoryTitle}}'
      contributorsTitleFormat: '#### Contributors'
      preset: conventional-commits
      append:
        enabled: true

Given an initial CHANGELOG.md such as

CHANGELOG.md
# Changelog

Lorem isum dolor sit amet.

<!-- JRELEASER_CHANGELOG_APPEND - Do not remove or modify this section -->

The updated changelog for a 1.0.0 releas would look like this

CHANGELOG.md
# Changelog

Lorem isum dolor sit amet.

<!-- JRELEASER_CHANGELOG_APPEND - Do not remove or modify this section -->
## [v1.0.0]

### Changelog

#### πŸ›   Build
- 2454d3a Add arguments to Main class (Andres Almiray)
- 9797539 Use fetch-depth=0 when checking out on release (Andres Almiray)
- ca15da0 Add Maven assembly descriptor (Andres Almiray)
- 8270c4f Setup build & release workflows (Andres Almiray)
- 1442ef0 Add JReleaser configuration (Andres Almiray)
- 839fab8 Add Maven wrapper files (Andres Almiray)
- 0cd14e9 Add sources (Andres Almiray)
- fd17794 Add license file (Andres Almiray)

---
- 51c3234 Init repository (Andres Almiray)


#### Contributors
We'd like to thank the following people for their contributions:
Andres Almiray

Note the use of a special comment as anchor for finding the right place to append the generated changelog. If the anchor does not exist then the generated changelog will be prepended at the beginning of the full changelog.

Note
Changelog appending is only active when a project is not snapshot.
Important
JReleaser does not verify if a previous tag is already found in the full changelog before appending.