Bump your semantic version of any software using regex
Project description
bump semver anywhere
This is a library intented to replace all semversion bumpers and finally be agnostic of the language / use case for your semantic versioning. This is achieved by providing the regex pattern to the place and filename of the string that contains the semantic version.
usage
- install
pip install bump_semver_anywhere
- create a
bump_semver_anywhere.toml
in the root of your project (see config example) - run
bump_semver_anywhere -p patch
cli
❯ bump_semver_anywhere --help
Usage: bump_semver_anywhere [OPTIONS]
Bump your semantic version of any software using regex
Options:
-c, --config FILE the config file [default:
bump_semver_anywhere.toml]
-p, --part [major|minor|patch|prerelease]
the version part to bump [required]
-n, --dry-run do not modify files
--help Show this message and exit.
config example
The following example will bump the version for docker and a python or javascript package.
# bump_semver_anywhere.toml
[general]
current_version = "0.1.0"
[vcs]
commit = true
commit_msg = "release({part}): bump {current_version} -> {new_version}"
[files]
[files.docker]
filename = "docker-compose.yaml"
pattern = 'image:.*?:(.*?)"'
[files.python-module]
filename = "__init__.py"
pattern = '__version__ ?= ?"(.*?)"'
[files.python-pyproject]
filename = "pyproject.toml"
pattern = 'version ?= ?"(.*?)"'
[files.javascript]
filename = "package.json"
pattern = '"version": ?"(.*?)"'
github action
See .github/workflows/bump_semver_anywhere.yaml
to integrate the action to your repo and change uses: ./
to uses: scratchmex/bump_semver_anywhere@main
The current behaviour is to comment /release <part>
(e.g. /release patch
) in a pull request.
Per default it pushes the bump commit to the branch the PR points to.
Therefore it should be commented after accepting the PR
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bump_semver_anywhere-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36004b941b5a4df5e8617330d50e3a9309544f3cd4ca2468a64574f74206b375 |
|
MD5 | 18a184e7fa8609055b65b8e284f77d0a |
|
BLAKE2b-256 | 95f03e7b64b034cc6419efc0fd2fc8600792acca45f8203bef10343691952238 |
Hashes for bump_semver_anywhere-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60fda6af9898ab07ab9086cf573558191c8f258c01c5080ede9239db3c7a8d3c |
|
MD5 | adae9675611a78778249447feb6c5853 |
|
BLAKE2b-256 | d683deff267482263f504aa786a78aa2251c584ab1da5c8ad78255e2651c5c09 |