Skip to content

Commit

Permalink
docs: add additional documentation to usage and development
Browse files Browse the repository at this point in the history
  • Loading branch information
idc101 committed May 21, 2020
1 parent fe98c71 commit 9879740
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 18 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# git-mkver

Helps version your software and patch version numbers into the build.
Automatic Semantic Versioning for git based software development.

For more information head to the [project site](https://idc101.github.io/git-mkver/).

Expand Down Expand Up @@ -28,8 +28,14 @@ Download the binary for your os from the [releases](https://github.com/idc101/gi

## Usage

Basic usage is to just call `git mkver next` and it will tell you the next
version of the software if you publish now.
Start by using [Conventional Commits](https://www.conventionalcommits.org/) to indicate whether the commits contain
major, minor or patch level changes.

```bash
$ git commit -m "feat: added a new feature (this will increment the minor version)"
```

Then call `git mkver next` and it will tell you the next version of the software should be if you publish now.

```bash
$ git mkver next
Expand All @@ -38,7 +44,7 @@ v0.4.0

### Tagging

If you would like to publish a version, mkver can tag the current commit.
If you would like to publish a version, git-mkver can tag the current commit.

```bash
$ git mkver tag
Expand All @@ -50,7 +56,7 @@ This will apply an annotated tag from the `next` command to the current commit.

If you would like to patch version numbers in files prior to building and tagging then
you can use the `patch` command. The files to be patched and the replacements are
defined in the `mkver.yaml` config file. A large number of standard patches come
defined in the `mkver.conf` config file. A large number of standard patches come
pre-defined.

```bash
Expand Down
30 changes: 30 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -e

# Note requires a previous version of git-mkver to have been built and on the path!
git mkver patch
version=`git mkver next`

sbt assembly

# Mac
if [[ "$(uname)" == "Darwin "]]
then
pushd target
native-image -H:IncludeResources='.*conf$' --no-fallback -jar scala-2.12/git-mkver-assembly-$version.jar
mv git-mkver-assembly-$version git-mkver-darwin-amd64-$version
popd

# Linux
docker run -v $(pwd):/workspace -it git-mkver \
/bin/bash -c "cd /workspace/target; native-image -H:IncludeResources='.*conf$' --no-fallback -jar scala-2.12/git-mkver-assembly-$version.jar; mv git-mkver-assembly-$version git-mkver-linux-amd64-$version"
fi

# Linux
if [[ "$(uname)" == "Linux "]]
then
pushd target
native-image -H:IncludeResources='.*conf$' --no-fallback -jar scala-2.12/git-mkver-assembly-$version.jar
mv git-mkver-assembly-$version git-mkver-linux-amd64-$version
popd
fi
27 changes: 18 additions & 9 deletions docs/common_patterns.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# Usage Patterns

## trunk/master based development
Below are some popular git branching development models and how to configure them with git-mkver:
- master (aka trunk) based development
- Git flow
- GitHub flow

This mode of operation is the default.
### Controlling the next version number

Regardless of the branching strategy, git-mkver uses the commit messages to determine the next version number.

See [Usage](usage) for more details.

## master (aka trunk) based development

This mode of operation works out of the box with the default configuration.

Overview:

- Developers commit to master or work on feature branches.
- All releases are done from the master branch.
- Developers commit to master or work on feature branches
- All releases are done from the master branch
- Only the master branch is tagged
- Release Candidates are not used
- Any version number not from master includes build metadata to indicate it is not an official release.
- Any version number not from master includes build metadata to indicate it is not an official release

### Build Server Setup

Expand All @@ -28,10 +39,8 @@ To control the frequency of releases, include these steps only on manually trigg

## Git flow

TODO
[Git Flow](https://nvie.com/posts/a-successful-git-branching-model/) is a long standing and popular branching model.

## GitHub flow

TODO

##
[GitHub Flow](https://guides.github.com/introduction/flow/) is a newer, simplified versioning model developed by GitHub.
19 changes: 19 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Development

## Graal Native Image

## Windows

Launch _Windows SDK 7.1 Command Prompt_

set JAVA_HOME=C:\Users\iain\Tools\graalvm-ce-java8-20.0.0\jre
set PATH=%JAVA_HOME%\bin;%PATH%

```
sbt assembly
native-image -jar target\scala-2.12\git-mkver-assembly-0.4.0.jar --no-fallback
```

## MacOs

## Linux
12 changes: 9 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# git mkver: Automatic Semantic Versioning

## Features

- Determine next version based on:
Expand All @@ -11,10 +13,14 @@
- C#
- Many others, fully configurable
- Tag the current commit with the next version
- Works with all branching strategies:
- [master/trunk based development](https://trunkbaseddevelopment.com/)
- [Git Flow](https://nvie.com/posts/a-successful-git-branching-model/)
- [GitHub Flow](https://guides.github.com/introduction/flow/)

All of this can be configured based on the branch name so release/master branches get different
version numbers to develop or feature branches.
All of this can be configured based on the branch name so release/master
branches get different version numbers to develop or feature branches.

## Getting started

[Install](installation) the binary and then read through the [usage](usage).
[Install](installation) the binary and then read through the [usage](usage).
6 changes: 5 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $ git mkver next
0.4.0
```

### Controlling the next version number
## Controlling the next version number

The next version number will be determined based on the commit messages since
the last version was tagged. The commit messages that trigger different version
Expand All @@ -24,6 +24,10 @@ increments are [configurable](config_reference) but by default they are as follo
- `patch:` or `patch(...):`
- `fix:` or `fix(...):`

All commit messages since the last tagged message are analyzed and the greatest
version increment is used. For example if one commit is a minor change and one is
a major change then the major version will be incremented.

## Common arguments

All commands take a `-c <FILE>` or `--config <FILE>` option to set the config file to read. More details on the
Expand Down

0 comments on commit 9879740

Please sign in to comment.