cargo-incver

Crates.iocargo-incver
lib.rscargo-incver
version1.0.0
sourcesrc
created_at2023-10-10 20:35:58.592063
updated_at2023-10-10 21:20:55.223805
descriptionA small utility for manipulating the project version in Cargo.toml
homepage
repositoryhttps://github.com/simensgreen/cargo-incvec
max_upload_size
id999462
size17,649
simens_green (simensgreen)

documentation

README

cargo-incver

A small utility for manipulating the project version in Cargo.toml

CLI usage

Print full version number

cargo incver full get

Increment minor version

cargo incver minor inc

Set custom pre version

cargo incver pre set alpha

Gitlab CI example

The example below shows an example of gitlab jobs that increment version numbers depending on the name of the merge request source branch

increment-patch:
  stage: deploy
  image: simensgreen/incver
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^patch/
  script:
    - cargo incver patch inc

increment-minor:
  stage: deploy
  image: simensgreen/incver
  rules:
    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^minor/
  script:
    - cargo incver minor inc

Where "simensgreen/incver" image is just:

FROM rust
RUN cargo install cargo-incver
Commit count: 3

cargo fmt