mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
42427782ac
* feat: nfpm support * fix: rpm * fix: rpm: bindir * fix: nfpm tests and coverage * chore: fixed nfpm version * chore: deliver goreleaser itself with nfpm * fix: add nfpm to the pipeline * chore: bump nfpm * bump: nfpm * docs: nfpm and deprecation notices * chore: nfpm v0.3.1
68 lines
1.8 KiB
Go
68 lines
1.8 KiB
Go
// Package defaults implements the Pipe interface providing default values
|
|
// for missing configuration.
|
|
package defaults
|
|
|
|
import (
|
|
"github.com/apex/log"
|
|
"github.com/goreleaser/goreleaser/context"
|
|
"github.com/goreleaser/goreleaser/pipeline"
|
|
"github.com/goreleaser/goreleaser/pipeline/archive"
|
|
"github.com/goreleaser/goreleaser/pipeline/artifactory"
|
|
"github.com/goreleaser/goreleaser/pipeline/brew"
|
|
"github.com/goreleaser/goreleaser/pipeline/build"
|
|
"github.com/goreleaser/goreleaser/pipeline/checksums"
|
|
"github.com/goreleaser/goreleaser/pipeline/docker"
|
|
"github.com/goreleaser/goreleaser/pipeline/env"
|
|
"github.com/goreleaser/goreleaser/pipeline/fpm"
|
|
"github.com/goreleaser/goreleaser/pipeline/nfpm"
|
|
"github.com/goreleaser/goreleaser/pipeline/release"
|
|
"github.com/goreleaser/goreleaser/pipeline/scoop"
|
|
"github.com/goreleaser/goreleaser/pipeline/sign"
|
|
"github.com/goreleaser/goreleaser/pipeline/snapcraft"
|
|
"github.com/goreleaser/goreleaser/pipeline/snapshot"
|
|
)
|
|
|
|
// Pipe that sets the defaults
|
|
type Pipe struct{}
|
|
|
|
func (Pipe) String() string {
|
|
return "setting defaults for:"
|
|
}
|
|
|
|
var defaulters = []pipeline.Defaulter{
|
|
env.Pipe{},
|
|
snapshot.Pipe{},
|
|
release.Pipe{},
|
|
archive.Pipe{},
|
|
build.Pipe{},
|
|
fpm.Pipe{},
|
|
nfpm.Pipe{},
|
|
snapcraft.Pipe{},
|
|
checksums.Pipe{},
|
|
sign.Pipe{},
|
|
docker.Pipe{},
|
|
artifactory.Pipe{},
|
|
brew.Pipe{},
|
|
scoop.Pipe{},
|
|
}
|
|
|
|
// Run the pipe
|
|
func (Pipe) Run(ctx *context.Context) error {
|
|
if ctx.Config.Dist == "" {
|
|
ctx.Config.Dist = "dist"
|
|
}
|
|
for _, defaulter := range defaulters {
|
|
log.Info(defaulter.String())
|
|
if err := defaulter.Default(ctx); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
if ctx.Config.ProjectName == "" {
|
|
ctx.Config.ProjectName = ctx.Config.Release.GitHub.Name
|
|
}
|
|
if ctx.Config.GitHubURLs.Download == "" {
|
|
ctx.Config.GitHubURLs.Download = "https://github.com"
|
|
}
|
|
return nil
|
|
}
|