mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-26 17:51:13 +08:00
chore: update gen-release-md command and README
This commit is contained in:
17
cmd/README.md
Normal file
17
cmd/README.md
Normal 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
|
||||
```
|
@@ -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 {
|
@@ -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
|
||||
```
|
Reference in New Issue
Block a user