2017-01-14 16:34:22 +02:00
|
|
|
package context
|
|
|
|
|
2017-01-15 00:01:32 +02:00
|
|
|
import "github.com/goreleaser/goreleaser/config"
|
2017-01-14 16:34:22 +02:00
|
|
|
|
|
|
|
// GitInfo includes tags and diffs used in some point
|
|
|
|
type GitInfo struct {
|
|
|
|
CurrentTag string
|
|
|
|
PreviousTag string
|
|
|
|
Diff string
|
|
|
|
}
|
|
|
|
|
2017-01-15 12:48:27 +02:00
|
|
|
// Repo owner/name pair
|
2017-01-14 16:34:22 +02:00
|
|
|
type Repo struct {
|
|
|
|
Owner, Name string
|
|
|
|
}
|
|
|
|
|
2017-01-15 12:48:27 +02:00
|
|
|
// Context carries along some data through the pipes
|
2017-01-14 16:34:22 +02:00
|
|
|
type Context struct {
|
2017-01-18 19:08:48 +02:00
|
|
|
Config config.Project
|
|
|
|
Token string
|
|
|
|
Git GitInfo
|
|
|
|
ReleaseRepo Repo
|
|
|
|
BrewRepo Repo
|
2017-01-14 23:47:15 +02:00
|
|
|
Archives map[string]string
|
2017-01-30 01:55:32 +02:00
|
|
|
Version string
|
2017-01-14 16:34:22 +02:00
|
|
|
}
|
|
|
|
|
2017-01-15 12:48:27 +02:00
|
|
|
// New context
|
2017-01-15 18:37:00 +02:00
|
|
|
func New(config config.Project) *Context {
|
2017-01-14 16:34:22 +02:00
|
|
|
return &Context{
|
2017-01-18 19:08:48 +02:00
|
|
|
Config: config,
|
2017-01-14 19:08:10 +02:00
|
|
|
Archives: map[string]string{},
|
2017-01-14 16:34:22 +02:00
|
|
|
}
|
|
|
|
}
|