chore: update gen-release-md command and README

This commit is contained in:
rushtehrani
2020-06-04 15:47:00 -07:00
parent b3e7ed5941
commit 327c73f22a
3 changed files with 28 additions and 14 deletions

17
cmd/README.md Normal file
View File

@@ -0,0 +1,17 @@
# Helper scripts
### gen-release-md.go
Generates markdown for releases.
Usage:
```bash
go run cmd/gen-release-md.go -v=0.10.0 > /tmp/release.md
```
### goose.go
Supports both Go and SQL migrations.
```bash
go run cmd/goose up # run up migrations
go run cmd/goose down # run down migrations
```

View File

@@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"net/http"
"strings"
)
type User struct {
@@ -91,19 +92,24 @@ func printMarkDown(issues []*Issue, version *string) {
continue
}
contributors[iss.User.Login] = iss.User
sections[iss.Labels[0].Name] += fmt.Sprintf("- %s ([#%d](%s))\n", iss.Title, iss.Number, iss.URL)
parts := strings.Split(iss.Title, ":")
if len(parts) > 0 {
contributors[iss.User.Login] = iss.User
sections[parts[0]] += fmt.Sprintf("- %s ([#%d](%s))\n", iss.Title, iss.Number, iss.URL)
}
}
releaseTemplate := fmt.Sprintf(releaseTemplate, *version, *version)
fmt.Println(releaseTemplate)
fmt.Println("# Changelog\n")
fmt.Println("## Features\n")
fmt.Println(sections["kind/enhancement"])
fmt.Println(sections["feat"])
fmt.Println("## Fixes\n")
fmt.Println(sections["kind/bug"])
fmt.Println(sections["fix"])
fmt.Println("## Docs\n")
fmt.Println(sections["kind/docs"])
fmt.Println(sections["docs"])
fmt.Println("## Chores\n")
fmt.Println(sections["chore"])
fmt.Println("# Contributors\n")
for _, user := range contributors {

View File

@@ -1,9 +0,0 @@
# Helper scripts
### generate-release-md.go
This script generates the markdown for releases:
Usage:
```bash
go run scripts/generate-release-md.go -v=0.10.0 > /tmp/release.md
```