1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +02:00
goreleaser/clients/client.go

36 lines
891 B
Go
Raw Normal View History

2017-04-14 15:39:32 -03:00
// Package clients contains the client implementations for several providers.
2017-03-26 14:46:25 -03:00
package clients
import (
"bytes"
"os"
"os/exec"
"github.com/goreleaser/goreleaser/context"
)
// Info of the repository
type Info struct {
Description string
Homepage string
URL string
}
// Client interface
type Client interface {
GetInfo(ctx *context.Context) (info Info, err error)
CreateRelease(ctx *context.Context) (releaseID int, err error)
CreateFile(ctx *context.Context, content bytes.Buffer, path string) (err error)
Upload(ctx *context.Context, releaseID int, name string, file *os.File) (err error)
}
func describeRelease(diff string) string {
result := "## Changelog\n" + diff + "\n\n--\nAutomated with @goreleaser"
cmd := exec.Command("go", "version")
bts, err := cmd.CombinedOutput()
if err != nil {
return result
}
return result + "\nBuilt with " + string(bts)
}