https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin
The rtldev-middleware-semantic-release-replace-plugin automates version and string updates in project files for seamless, error-free releases. Developed by CentralNic Group.
https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin
Last synced: 4 months ago
JSON representation
The rtldev-middleware-semantic-release-replace-plugin automates version and string updates in project files for seamless, error-free releases. Developed by CentralNic Group.
- Host: GitHub
- URL: https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-replace-plugin
- Owner: centralnicgroup-opensource
- License: apache-2.0
- Created: 2024-03-26T15:20:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-18T11:31:13.000Z (4 months ago)
- Last Synced: 2025-02-18T11:39:53.221Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.19 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Automated Semantic Release Plugin for Version Number Replacement and Date Management
[](https://www.npmjs.com/package/semantic-release-replace-plugin)


[](https://codecov.io/gh/jpoehnelt/semantic-release-replace-plugin)

[](https://github.com/semantic-release/semantic-release)The `semantic-release-replace-plugin` plugin provides functionality to update version strings throughout a project. This enables semantic release to be used in many different languages and build processes.
Read more about [Semantic Release](https://semantic-release.gitbook.io/).
## Install
```bash
$ npm install https://github.com/centralnicgroup-opensource/semantic-release-replace-plugin -D
```## Usage
The following example uses this plugin to demonstrate using semantic-release in a Python package where `__VERSION__` is defined in the root `__init__.py` file.
```json
{
"plugins": [
"@semantic-release/commit-analyzer",
[
"semantic-release-replace-plugin",
{
"replacements": [
{
"files": ["foo/**.py"],
"from": "__VERSION__ = \".*\"",
"to": "__VERSION__ = \"${nextRelease.version}\"",
"ignore" ["foo/go.py"],
"results": [
{
"file": "foo/__init__.py",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
}
]
}
],
[
"@semantic-release/git",
{
"assets": ["foo/*.py"]
}
]
]
}
```### Validation
The presence of the `results` array will trigger validation that a replacement has been made. This is optional but recommended.
### Warning
This plugin will not commit changes unless you specify assets for the @semantic-release/git plugin! This is highlighted below.
```
[
"@semantic-release/git",
{
"assets": ["foo/*.py"]
}
]
```## Options
Please refer to the [documentation](./docs/README.md) for more options.