# SEMVER Manager

Set of `mix` tasks for updating the SEMVER of your project
automatically.

A tool to quickly bump any field of a well constructed SEMVER string
in your `mix.exs` file.

> Given a version number MAJOR.MINOR.PATCH, increment the:
>
> MAJOR version when you make incompatible API changes
> MINOR version when you add functionality in a backward compatible manner
> PATCH version when you make backward compatible bug nfixes
> Additional labels for pre-release and build metadata are available
> as extensions to the MAJOR.MINOR.PATCH format.

[SEMVER 2.0.0](https://semver.org/spec/v2.0.0.html)


## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `semver_mgr` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:semver_mgr, "~> 1.0", only: :dev, runtime: false}
  ]
end
```

## Usage

To increment your patch version automatically run. You will still need
to commit this change afterwards.

```bash
mix semver.increment
```

Aditionally you may specify which field you would like to increment,
and optionally by how much.

```bash
mix semver.increment minor 3
Incremented 0.1.0 -> 0.4.0
```

By default incremeting a `Major` or `Minor` version will reset the
lower fields to 0. This may be skipped by using the `--preserve` flag.

```bash
mix semver.increment major --preserve patch
Incremented 1.2.3 -> 2.0.3

mix semver.increment major --preserve
Incremented 1.2.3 -> 2.2.3
```


Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/semver_mgr>.

