-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
43 lines (35 loc) · 769 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"flag"
"fmt"
"github.com/benjlevesque/gh-bump/pkg/bump"
"github.com/benjlevesque/gh-bump/pkg/gh"
)
var dryRun = flag.Bool("dryRun", false, "")
var title = flag.String("title", "", "the release title")
func main() {
flag.Parse()
bumpType, err := bump.ParseFlagsToBumpType()
if err != nil {
fmt.Println(err)
return
}
latest, err := gh.GetLatestRelease()
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("latest is %s, ", latest)
newTag := bump.GetNewTag(latest, bumpType)
fmt.Printf("next is %s\n", newTag)
if *dryRun {
fmt.Printf("[Dry Run] creating release for %s\n", newTag)
return
}
release, err := gh.CreateRelease(newTag, *title)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(release)
}