You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-8Lines changed: 40 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,37 @@
1
1
# Semantic Versioning Tool
2
2
3
-
An easy to use CLI tool to manage your projects current version and its upgrades according to the Semantic Versioning specification.
4
-
3
+
An easy to use CLI tool to manage your projects current version and its upgrades according to the Semantic Versioning
4
+
specification.
5
5
6
6
## Getting Started
7
7
8
8
### Install
9
+
9
10
If you already have golang installed you can install by running the command:
11
+
10
12
```sh
11
-
go get -u github.com/maykonlf/semver-cli/cmd/semver
13
+
go install github.com/maykonlf/semver-cli/cmd/semver@latest
12
14
```
13
15
14
16
### check install
17
+
15
18
Check if the semver was instaled running the command:
19
+
16
20
```sh
17
21
semver
18
22
```
19
23
20
-
21
24
### Init semver
25
+
22
26
To start managing your project versions enter into the project folder, then run:
27
+
23
28
```sh
24
29
semver init
25
30
```
26
31
27
-
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:
32
+
This command will start the versioning based on release version v1.0.0. If you want to start with another version number
33
+
you car run instead:
34
+
28
35
```sh
29
36
semver init \
30
37
--release [base release version] \
@@ -34,62 +41,79 @@ semver init \
34
41
[--force] # to override an already initialized semver in the current directory.
35
42
```
36
43
37
-
38
44
## Usage
39
45
40
46
### Get current version
47
+
41
48
#### Alpha
49
+
42
50
Returns the current alpha version (if none will return and "-alpha.0" version).
51
+
43
52
```sh
44
53
$ semver get alpha
45
54
v1.0.0-alpha.6
46
55
```
47
56
48
57
#### Beta
58
+
49
59
Returns the current beta version (if none will return and "-beta.0" version).
60
+
50
61
```sh
51
62
$ semver get beta
52
63
v1.0.0-beta.3
53
64
```
54
65
55
66
#### Release Candidate
67
+
56
68
Returns the current release candidate version (if none will return and "-rc.0" version).
69
+
57
70
```sh
58
71
$ semver get rc
59
72
v1.0.0-rc.1
60
73
```
61
74
62
75
#### Release
76
+
63
77
Returns the current release version.
78
+
64
79
```sh
65
80
$ semver get release
66
81
v1.0.0
67
82
```
68
83
69
84
### Upgrade version
85
+
70
86
#### Alpha
87
+
71
88
Increment the current alpha version by 1. If none starts with 1.
89
+
72
90
```sh
73
91
$ semver up alpha
74
92
v1.0.0-alpha.7
75
93
```
76
94
77
95
#### Beta
96
+
78
97
Increment the current beta version by 1. If none starts with 1.
98
+
79
99
```sh
80
100
$ semver up beta
81
101
v1.0.0-beta.4
82
102
```
83
103
84
104
#### Release Candidate
105
+
85
106
Increment the current release candidate version by 1. If none starts with 1.
107
+
86
108
```sh
87
109
$ semver up rc
88
110
v1.0.0-rc.2
89
111
```
90
112
91
113
#### Release
114
+
92
115
Upgrade an alpha, beta or rc to its final release version. Also increments the patch number by 1 to a release version:
116
+
93
117
```sh
94
118
$ semver up release
95
119
v1.0.0
@@ -99,13 +123,17 @@ v1.0.1
99
123
```
100
124
101
125
#### Minor
102
-
Increments release minor version number by 1 (useful when you start working on next release version) and clear alpha, beta, rc and patch number.
126
+
127
+
Increments release minor version number by 1 (useful when you start working on next release version) and clear alpha,
128
+
beta, rc and patch number.
129
+
103
130
```sh
104
131
$ semver up minor
105
132
v1.1.0
106
133
```
107
134
108
135
Before you upgrade the minor version the next versions will be generated based on this new minor version.
136
+
109
137
```sh
110
138
$ semver up alpha
111
139
v1.1.0-alpha.1
@@ -118,13 +146,17 @@ v1.1.0-rc.1
118
146
```
119
147
120
148
#### Major
121
-
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.
149
+
150
+
Upgrades the current version to the next major version (when you starts working on a new version with branking changes)
151
+
and clear alpha, beta, rc, patch and minor number.
152
+
122
153
```sh
123
154
$ semver up major
124
155
v2.0.0
125
156
```
126
157
127
158
Before them, your next versions will be generated based on this new version.
0 commit comments