Telegram
Configuration
Legend:
-
required
-
optional
-
may use environment variable
-
accepts Name Templates
#
announce:
#
telegram:
# Enables or disables Telegram.
# Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
# Defaults to `NEVER`.
#
active: ALWAYS
# Defines the connection timeout in seconds.
# Defaults to `20`.
#
connectTimeout: 20
# Defines the read timeout in seconds.
# Defaults to `60`.
#
readTimeout: 60
# Additional properties used when evaluating templates.
#
extraProperties:
# Key will be capitalized and prefixed with `telegram`, i.e, `telegramFoo`.
foo: bar
# The token associated with a Telegram bot.
#
token: __USE_ENVIRONMENT_VARIABLE__
# The identifier of the chat where announcemnts will be posted.
#
chatId: __USE_ENVIRONMENT_VARIABLE__
# The announcement message.
# Review the available Name Templates.
#
message: '🚀 {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'
# Path to a template file that contains the message.
# Review the available Name Templates.
# Defaults to `src/jreleaser/templates/telegram.tpl`.
#
messageTemplate: path/to/template/telegram.tpl
#
[announce.telegram]
# Enables or disables Telegram.
# Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
# Defaults to `NEVER`.
#
active = "ALWAYS"
# Defines the connection timeout in seconds.
# Defaults to `20`.
#
connectTimeout = 20
# Defines the read timeout in seconds.
# Defaults to `60`.
#
readTimeout = 60
# Additional properties used when evaluating templates.
#
extraProperties.foo = "bar"
# Key will be capitalized and prefixed with `telegram`, i.e, `telegramFoo`.
# The token associated with a Telegram bot.
#
token = "__USE_ENVIRONMENT_VARIABLE__"
# The identifier of the chat where announcemnts will be posted.
#
chatId = "__USE_ENVIRONMENT_VARIABLE__"
# The announcement message.
# Review the available Name Templates.
#
message = "🚀 {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}"
# Path to a template file that contains the message.
# Review the available Name Templates.
# Defaults to `src/jreleaser/templates/telegram.tpl`.
#
messageTemplate = "path/to/template/telegram.tpl"
{
//
"announce": {
//
"telegram": {
// Enables or disables Telegram.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
"active": "ALWAYS",
// Defines the connection timeout in seconds.
// Defaults to `20`.
//
"connectTimeout": 20,
// Defines the read timeout in seconds.
// Defaults to `60`.
//
"readTimeout": 60,
// Additional properties used when evaluating templates.
//
"extraProperties": {
// Key will be capitalized and prefixed with `telegram`, i.e, `telegramFoo`.
"foo": "bar"
},
// The token associated with a Telegram bot.
//
"token": "__USE_ENVIRONMENT_VARIABLE__",
// The identifier of the chat where announcemnts will be posted.
//
"chatId": "__USE_ENVIRONMENT_VARIABLE__",
// The announcement message.
// Review the available Name Templates.
//
"message": "🚀 {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}",
// Path to a template file that contains the message.
// Review the available Name Templates.
// Defaults to `src/jreleaser/templates/telegram.tpl`.
//
"messageTemplate": "path/to/template/telegram.tpl"
}
}
}
<jreleaser>
<!--
-->
<announce>
<!--
-->
<telegram>
<!--
Enables or disables Telegram.
Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
Defaults to `NEVER`.
-->
<active>ALWAYS</active>
<!--
Defines the connection timeout in seconds.
Defaults to `20`.
-->
<connectTimeout>20</connectTimeout>
<!--
Defines the read timeout in seconds.
Defaults to `60`.
-->
<readTimeout>60</readTimeout>
<!--
Additional properties used when evaluating templates.
-->
<extraProperties>
<!--
Key will be capitalized and prefixed with `telegram`, i.e, `telegramFoo`.
-->
<foo>bar</foo>
</extraProperties>
<!--
The token associated with a Telegram bot.
-->
<token>__USE_ENVIRONMENT_VARIABLE__</token>
<!--
The identifier of the chat where announcemnts will be posted.
-->
<chatId>__USE_ENVIRONMENT_VARIABLE__</chatId>
<!--
The announcement message.
Review the available Name Templates.
-->
<message>🚀 {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}</message>
<!--
Path to a template file that contains the message.
Review the available Name Templates.
Defaults to `src/jreleaser/templates/telegram.tpl`.
-->
<messageTemplate>path/to/template/telegram.tpl</messageTemplate>
</telegram>
</announce>
</jreleaser>
jreleaser {
//
announce {
//
telegram {
// Enables or disables Telegram.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
active = 'ALWAYS'
// Defines the connection timeout in seconds.
// Defaults to `20`.
//
connectTimeout = 20
// Defines the read timeout in seconds.
// Defaults to `60`.
//
readTimeout = 60
// Additional properties used when evaluating templates.
// Key will be capitalized and prefixed with `telegram`, i.e, `telegramFoo`.
//
extraProperties.put('foo', 'bar')
// The token associated with a Telegram bot.
//
token = '__USE_ENVIRONMENT_VARIABLE__'
// The identifier of the chat where announcemnts will be posted.
//
chatId = '__USE_ENVIRONMENT_VARIABLE__'
// The announcement message.
// Review the available Name Templates.
//
message = '🚀 {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'
// Path to a template file that contains the message.
// Review the available Name Templates.
// Defaults to `src/jreleaser/templates/telegram.tpl`.
//
messageTemplate = 'path/to/template/telegram.tpl'
}
}
}
You may define either message or messageTemplate, with the former taking precedence over the latter.
Environment
When not explicitly set, the value of the following properties may be resolved from an environment variable or a system property as shown in the table. The system property takes precedence over the environment variable.
| System Property | Environment Variable |
|---|---|
active |
|
jreleaser.announce.telegram.active |
JRELEASER_ANNOUNCE_TELEGRAM_ACTIVE |
token |
|
jreleaser.announce.telegram.token |
JRELEASER_ANNOUNCE_TELEGRAM_TOKEN |
chatId |
|
jreleaser.announce.telegram.chat.id |
JRELEASER_ANNOUNCE_TELEGRAM_CHAT_ID |