mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
809cb682d2
* 'master' of https://github.com/goreleaser/goreleaser: fixed name on --help removed unneeded pointers from context
35 lines
559 B
Go
35 lines
559 B
Go
package git
|
|
|
|
import "github.com/goreleaser/goreleaser/context"
|
|
|
|
// Pipe for brew deployment
|
|
type Pipe struct{}
|
|
|
|
// Description of the pipe
|
|
func (Pipe) Description() string {
|
|
return "Getting Git info"
|
|
}
|
|
|
|
// Run the pipe
|
|
func (Pipe) Run(ctx *context.Context) (err error) {
|
|
tag, err := currentTag()
|
|
if err != nil {
|
|
return
|
|
}
|
|
previous, err := previousTag(tag)
|
|
if err != nil {
|
|
return
|
|
}
|
|
log, err := log(previous, tag)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
ctx.Git = context.GitInfo{
|
|
CurrentTag: tag,
|
|
PreviousTag: previous,
|
|
Diff: log,
|
|
}
|
|
return
|
|
}
|