gen-semver-tags

Crates.iogen-semver-tags
lib.rsgen-semver-tags
version0.1.0
created_at2025-02-27 18:50:14.243228+00
updated_at2025-02-27 19:43:15.607423+00
descriptionGenerate a set of SemVer tags, e.g. to tag container images.
homepage
repositoryhttps://github.com/jgosmann/gen-semver-tags
max_upload_size
id1572041
size53,260
Jan Gosmann (jgosmann)

documentation

README

gen-semver-tags

Generate a list of semantic versioning tags for a given version.

These can, for example, be used to tag Docker images to allow pulling the latest major or minor version.

$ echo "1.0.0" | gen-semver-tags 1.1.0
1.1.0
1.1
1
latest

$ echo "1.0.0" | gen-semver-tags 1.1.0
1.1.0
1.1
1
latest

$ echo "1.0.0\n1.1.0" | gen-semver-tags 1.0.1
1.0.1
1.0

$ echo "1.0.0" | gen-semver-tags --latest-tags latest,stable 1.1.0
1.1.0
1.1
1
latest
stable

$ echo "1.0.0" | gen-semver-tags --latest-tags '' 1.1.0
1.1.0
1.1
1

Given a version and already existing versions via standard input (separated by newlines), a list of tags following Semantic Versioning is generated and written to standard output. For a version major.minor.patch, major.minor.patch will always be included. If the version, is the latest minor version of the given major version, major.minor will be included. If the version is the latest major version, major and the latest_tags will be included.

This tags can be used, for example, to tag Docker images, such that by using just a major (or minor) version, the latest image of that major (or minor) version is pulled.

Pre-release versions are never considered to be the latest version.

Build metadata is ignored.

Commit count: 23

cargo fmt