From 08a9e30473addf4881a19a14b75b271a1b81ce58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20B=C3=B6schen?= Date: Sat, 10 Apr 2021 10:24:03 +0200 Subject: [PATCH] Update docs --- README.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3bbf99..f2222a5 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,36 @@ +[![Go Reference](https://pkg.go.dev/badge/github.com/Deichindianer/semver-go.svg)](https://pkg.go.dev/github.com/Deichindianer/semver-go) +[![Go Report Card](https://goreportcard.com/badge/github.com/Deichindianer/semver-go?style=flat-square)](https://goreportcard.com/report/github.com/Deichindianer/semver-go) + # semver-go -## Usage +"Get me the next patch, minor or major version of this git repository." + +semver-go provides an interface to do that really easily without any dependencies for the cli. Currently this package does only support the patch, minor and major components of the [semantic versioning spec](https://semver.org). + +This repository contains two things + +* The `sem` package that provides an interface for SemVer versioning +* `semver` a cli that allows you to just get the next version easily from your command line or CI job shell + +## CLI Usage + +`semver` will keep your version prefixes if you have any. It will then print out the next version to stdout. ```sh -git tag $(semver patch) +# git repository with the latest tag v1.0.0 +$ semver patch +v1.0.1 ``` +## Sem package usage + +Find most of the detailed docs on [pkg.go.dev](https://pkg.go.dev/github.com/Deichindianer/semver-go). + +The main exposed functions are + +* `GetLatestVersion` getting the latest version out of a git repository +* The `Ver` struct that provides an interface to your version and the `Next` function that increments the version in place + ## Credits -* [mycrEEpy](https://github.com/mycrEEpy) for staying with me :) +* [mycrEEpy](https://github.com/mycrEEpy) for developing this entire thing in tandem with me.