@team-internet/semantic-release-plugins
v1.0.7
Published
CentralNic semantic-release plugin collection.
Readme
@team-internet/semantic-release-plugins
Reusable semantic-release plugins for Team Internet release pipelines.
This package provides plugins for common release tasks: updating files with the next release version, sending Microsoft Teams notifications, overriding release notes, and publishing Maven projects.
Requirements
- Node.js
^22.14.0 || >=24.10.0 - semantic-release
25or a compatible release pipeline
Installation
pnpm add -D @team-internet/semantic-release-pluginsAvailable Plugins
| Plugin | Config value | Runs during |
| ---------------- | -------------------------------------------------------- | --------------------------------------------------- |
| replace | @team-internet/semantic-release-plugins/replace | prepare |
| notify | @team-internet/semantic-release-plugins/notify | verifyConditions, success |
| teams-notify | @team-internet/semantic-release-plugins/teams-notify | verifyConditions, success |
| notes-override | @team-internet/semantic-release-plugins/notes-override | verifyConditions, generateNotes |
| maven | @team-internet/semantic-release-plugins/maven | verifyConditions, prepare, publish, success |
Quick Start
Add the plugin subpath you need to your semantic-release configuration.
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@team-internet/semantic-release-plugins/replace",
{
"replacements": [
{
"files": ["src/version.js"],
"from": "__VERSION__ = \\\".*\\\"",
"to": "__VERSION__ = \\\"${nextRelease.version}\\\""
}
]
}
],
"@team-internet/semantic-release-plugins/notify",
"@semantic-release/github"
]
}replace
Use replace to update files during prepare. Replacement strings can reference semantic-release context values such as ${nextRelease.version}.
[
"@team-internet/semantic-release-plugins/replace",
{
"replacements": [
{
"files": ["package.json"],
"from": "\\\"version\\\": \\\".*\\\"",
"to": "\\\"version\\\": \\\"${nextRelease.version}\\\""
}
]
}
]Each replacement accepts the standard replace-in-file options. String from values are converted to global, multiline regular expressions. to can be a string, array, or callback.
Add results to a replacement when you want the release to fail unless the actual replacement result matches the expected files, matches, or replacement counts.
notify / teams-notify
Use notify to send a Microsoft Teams notification after a successful release. teams-notify is an alias for the same plugin.
[
"@team-internet/semantic-release-plugins/notify",
{
"teamsWebhook": "https://example.webhook.office.com/...",
"packageName": "my-service"
}
]Configuration can be passed in plugin options or through environment variables.
| Setting | Environment fallback | Required |
| ------------------ | ------------------------------------------------------------------- | -------- |
| teamsWebhook | TEAMS_NOTIFICATION_URI | Yes |
| githubToken | GH_TOKEN, GITHUB_TOKEN | Yes |
| packageName | SEMANTIC_RELEASE_PACKAGE, npm_package_name, package.json#name | Yes |
| commitSHA | COMMIT_SHA | No |
| notificationType | TEAMS_NOTIFICATION_TYPE | No |
Teams notifications are designed for Microsoft Teams Workflows webhooks created from the Workflows app template "Send webhook alerts to a channel" or equivalent. The default payload uses the Adaptive Card request body shape supported by Workflows.
notes-override
Use notes-override when release notes are supplied by the pipeline instead of generated by semantic-release.
[
"@team-internet/semantic-release-plugins/notes-override",
{
"notes": "Release notes supplied by the pipeline"
}
]The plugin returns the configured notes after stripping Markdown links. The notes value can also come from customReleaseNotes in the semantic-release environment.
maven
Use maven to release Maven projects from semantic-release.
[
"@team-internet/semantic-release-plugins/maven",
{
"mvnw": true,
"settingsPath": "./settings.xml",
"mavenTarget": "deploy",
"processAllModules": true,
"updateSnapshotVersion": true
}
]The plugin checks Maven availability, updates pom.xml files to the release version, runs the configured Maven publish target, and can optionally commit the next snapshot version after a successful release.
| Option | Default | Description |
| ----------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------- |
| mvnw | false | Use ./mvnw instead of mvn. |
| settingsPath | unset | Passed as --settings. Only word characters, ~, ., /, and - are allowed. |
| mavenTarget | deploy | One of deploy, package jib:build, or deploy jib:build. |
| clean | true | Prefix the publish command with clean. |
| processAllModules | false | Pass -DprocessAllModules to version update commands. |
| updateSnapshotVersion | false | Update to the next snapshot after a successful release. |
| snapshotCommitMessage | chore: setting next snapshot version [skip ci] | Commit message used when updateSnapshotVersion is enabled. |
| opts | "" | Additional Maven arguments split on spaces. |
| debug | false | Add Maven -X. |
Debugging
Set DEBUG to the plugin namespace that should emit debug output:
DEBUG=semantic-release:notify pnpm semantic-release
DEBUG=semantic-release:teams-notify pnpm semantic-release
DEBUG=semantic-release:notes-override pnpm semantic-releaseFor Maven command output, set the plugin option debug to true to pass -X to Maven.
