-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add prerelease and metadata flags (#7)
* add prerelease and metadata flags * Update README * Update dockerfile and actions [bump minor]
- Loading branch information
Showing
8 changed files
with
143 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,58 @@ | ||
package bump | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
) | ||
|
||
func TestBumps(t *testing.T) { | ||
// ehhh, TODO, too lazy | ||
// s := "1.2.3" | ||
// c := &cli.Context{} | ||
// c.Set("filename") | ||
// bump() | ||
s := "1.2.3" | ||
s2, err := BumpString(s, &Options{Part: "patch"}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
fmt.Println(s2) | ||
if s2 != "1.2.4" { | ||
t.Fatal("Expected 1.2.4") | ||
} | ||
s = "1.2.3" | ||
s2, err = BumpString(s, &Options{Part: "minor"}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
fmt.Println(s2) | ||
if s2 != "1.3.0" { | ||
t.Fatal("Expected 1.3.0, got", s2) | ||
} | ||
|
||
s = "1.2.3-alpha" | ||
s2, err = BumpString(s, &Options{Part: "patch"}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
fmt.Println(s2) | ||
if s2 != "1.2.4" { | ||
t.Fatal("Expected 1.2.4, got", s2) | ||
} | ||
|
||
s = "1.2.3-alpha" | ||
s2, err = BumpString(s, &Options{Part: "minor", PreRelease: "alpha"}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
fmt.Println(s2) | ||
if s2 != "1.3.0-alpha" { | ||
t.Fatal("Expected 1.3.0-alpha, got", s2) | ||
} | ||
|
||
s = "1.2.3-alpha" | ||
s2, err = BumpString(s, &Options{Part: "minor", PreRelease: "alpha", Metadata: "build123"}) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
fmt.Println(s2) | ||
if s2 != "1.3.0-alpha+build123" { | ||
t.Fatal("Expected 1.3.0-alpha+build123, got", s2) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
module github.com/treeder/bump | ||
|
||
go 1.12 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/coreos/go-semver v0.3.0 | ||
github.com/coreos/go-semver v0.3.1 | ||
github.com/urfave/cli v1.21.0 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= | ||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= | ||
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= | ||
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= | ||
github.com/urfave/cli v1.21.0 h1:wYSSj06510qPIzGSua9ZqsncMmWE3Zr55KBERygyrxE= | ||
github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= | ||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |