Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependencies, upgrade go to 1.17 #13

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine3.10 as builder
FROM golang:1.17-alpine as builder
RUN mkdir /build
ADD . /build/
WORKDIR /build
Expand Down
48 changes: 40 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
# Semantic Versioning Tool

An easy to use CLI tool to manage your projects current version and its upgrades according to the Semantic Versioning specification.

An easy to use CLI tool to manage your projects current version and its upgrades according to the Semantic Versioning
specification.

## Getting Started

### Install

If you already have golang installed you can install by running the command:

```sh
go get -u github.com/maykonlf/semver-cli/cmd/semver
go install github.com/maykonlf/semver-cli/cmd/semver@latest
```

### check install

Check if the semver was instaled running the command:

```sh
semver
```


### Init semver

To start managing your project versions enter into the project folder, then run:

```sh
semver init
```

This command will start the versioning based on release version v1.0.0. If you want to start with another version number you car run instead:
This command will start the versioning based on release version v1.0.0. If you want to start with another version number
you car run instead:

```sh
semver init \
--release [base release version] \
Expand All @@ -34,62 +41,79 @@ semver init \
[--force] # to override an already initialized semver in the current directory.
```


## Usage

### Get current version

#### Alpha

Returns the current alpha version (if none will return and "-alpha.0" version).

```sh
$ semver get alpha
v1.0.0-alpha.6
```

#### Beta

Returns the current beta version (if none will return and "-beta.0" version).

```sh
$ semver get beta
v1.0.0-beta.3
```

#### Release Candidate

Returns the current release candidate version (if none will return and "-rc.0" version).

```sh
$ semver get rc
v1.0.0-rc.1
```

#### Release

Returns the current release version.

```sh
$ semver get release
v1.0.0
```

### Upgrade version

#### Alpha

Increment the current alpha version by 1. If none starts with 1.

```sh
$ semver up alpha
v1.0.0-alpha.7
```

#### Beta

Increment the current beta version by 1. If none starts with 1.

```sh
$ semver up beta
v1.0.0-beta.4
```

#### Release Candidate

Increment the current release candidate version by 1. If none starts with 1.

```sh
$ semver up rc
v1.0.0-rc.2
```

#### Release

Upgrade an alpha, beta or rc to its final release version. Also increments the patch number by 1 to a release version:

```sh
$ semver up release
v1.0.0
Expand All @@ -99,13 +123,17 @@ v1.0.1
```

#### Minor
Increments release minor version number by 1 (useful when you start working on next release version) and clear alpha, beta, rc and patch number.

Increments release minor version number by 1 (useful when you start working on next release version) and clear alpha,
beta, rc and patch number.

```sh
$ semver up minor
v1.1.0
```

Before you upgrade the minor version the next versions will be generated based on this new minor version.

```sh
$ semver up alpha
v1.1.0-alpha.1
Expand All @@ -118,13 +146,17 @@ v1.1.0-rc.1
```

#### Major
Upgrades the current version to the next major version (when you starts working on a new version with branking changes) and clear alpha, beta, rc, patch and minor number.

Upgrades the current version to the next major version (when you starts working on a new version with branking changes)
and clear alpha, beta, rc, patch and minor number.

```sh
$ semver up major
v2.0.0
```

Before them, your next versions will be generated based on this new version.

```sh
$ semver up alpha
v2.0.0-alpha.1
Expand Down
30 changes: 22 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
module github.com/maykonlf/semver-cli

go 1.13
go 1.17

require (
github.com/pelletier/go-toml v1.6.0 // indirect
github.com/smartystreets/goconvey v1.6.4
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.10.1
)

require (
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.6.1
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 // indirect
golang.org/x/text v0.3.2 // indirect
gopkg.in/yaml.v2 v2.2.7
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading