Tired of multiple files with your package version inside? It's over!
Sometimes you put too many utilities and config files to your repository. And many of them require you to specify version of your package.
Usually you would rely on CI/CD like this:
- Push Git
tagwith version - Get it as environment variable
sedinside all files- Release
What if you can update version across all the places at one? Try over
To start using over you just need to add one config file (.over.yaml) to your project. Let's see over's config:
package:
name: over
version: "0.1.0"
files:
- name: README.md
templates:
- https://img.shields.io/badge/version-__VERSION__-blue
- 'version: "__VERSION__"'
- name: cmd/version.go
templates:
- fmt.Println("__VERSION__")nameis well self-explanatoryversionis the only source of truth for your project nowfilesis the most interesting part. In here you specify all files and patterns which should be replaced with new version.
files array contains objects:
name: filename (relative to project's root)templates: array of lines, containing version
You may find sort of "inception" now. over's config is updating package's version inside README.md (twice).
Part:
package:
name: over
version: "0.1.0" # <=== It's text in README.md
...And:
...
- name: README.md
templates:
- https://img.shields.io/badge/version-__VERSION__-blue
- version: "__VERSION__" # <=== This template says "Replace version that looks like this in README.md"Important:
To avoid non-valid files, over doesn't require you to put __VERSION__ to each and every file.
When you are setting up project the first time - just put the same version everywhere (for example 0.0.1).
But when you configure .over.yaml - replace this version with __VERSION__ in a template.
Therefore, you will get updated version everywhere without need to compromise on your code check
- Get current version (also available as Github action):
over get- Get current version of nested package (mono-repository friendly):
over --config nested-package/.over.yaml - Bump patch (
v0.0.1 => v0.0.2)
over up --patch --inplaceNote: Without --inspace it'll just post next version
- Bump minor (
v0.1.5 => v0.2.0)
over up -i --minor- Bump major (
v0.2.6 => v1.0.0)
over up -i --major - Shortcuts also available
# Eq: --patch --inplace
over up -pi
# Eq: --minor --inplace
over up -mi
# Eq: --major --inplace
over up -Mi