github.com/ahmet2mir/goreleaser@v0.180.3-0.20210927151101-8e5ee5a9b8c5/internal/pipeline/pipeline.go (about)

     1  // Package pipeline provides generic erros for pipes to use.
     2  package pipeline
     3  
     4  import (
     5  	"fmt"
     6  
     7  	"github.com/goreleaser/goreleaser/internal/pipe/announce"
     8  	"github.com/goreleaser/goreleaser/internal/pipe/archive"
     9  	"github.com/goreleaser/goreleaser/internal/pipe/before"
    10  	"github.com/goreleaser/goreleaser/internal/pipe/brew"
    11  	"github.com/goreleaser/goreleaser/internal/pipe/build"
    12  	"github.com/goreleaser/goreleaser/internal/pipe/changelog"
    13  	"github.com/goreleaser/goreleaser/internal/pipe/checksums"
    14  	"github.com/goreleaser/goreleaser/internal/pipe/defaults"
    15  	"github.com/goreleaser/goreleaser/internal/pipe/dist"
    16  	"github.com/goreleaser/goreleaser/internal/pipe/docker"
    17  	"github.com/goreleaser/goreleaser/internal/pipe/effectiveconfig"
    18  	"github.com/goreleaser/goreleaser/internal/pipe/env"
    19  	"github.com/goreleaser/goreleaser/internal/pipe/git"
    20  	"github.com/goreleaser/goreleaser/internal/pipe/gomod"
    21  	"github.com/goreleaser/goreleaser/internal/pipe/nfpm"
    22  	"github.com/goreleaser/goreleaser/internal/pipe/publish"
    23  	"github.com/goreleaser/goreleaser/internal/pipe/scoop"
    24  	"github.com/goreleaser/goreleaser/internal/pipe/semver"
    25  	"github.com/goreleaser/goreleaser/internal/pipe/sign"
    26  	"github.com/goreleaser/goreleaser/internal/pipe/snapcraft"
    27  	"github.com/goreleaser/goreleaser/internal/pipe/snapshot"
    28  	"github.com/goreleaser/goreleaser/internal/pipe/sourcearchive"
    29  	"github.com/goreleaser/goreleaser/pkg/context"
    30  )
    31  
    32  // Piper defines a pipe, which can be part of a pipeline (a series of pipes).
    33  type Piper interface {
    34  	fmt.Stringer
    35  
    36  	// Run the pipe
    37  	Run(ctx *context.Context) error
    38  }
    39  
    40  // BuildPipeline contains all build-related pipe implementations in order.
    41  // nolint:gochecknoglobals
    42  var BuildPipeline = []Piper{
    43  	env.Pipe{},             // load and validate environment variables
    44  	git.Pipe{},             // get and validate git repo state
    45  	semver.Pipe{},          // parse current tag to a semver
    46  	before.Pipe{},          // run global hooks before build
    47  	defaults.Pipe{},        // load default configs
    48  	snapshot.Pipe{},        // snapshot version handling
    49  	dist.Pipe{},            // ensure ./dist is clean
    50  	gomod.Pipe{},           // setup gomod-related stuff
    51  	gomod.ProxyPipe{},      // proxy gomod if needed
    52  	effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist
    53  	changelog.Pipe{},       // builds the release changelog
    54  	build.Pipe{},           // build
    55  }
    56  
    57  // Pipeline contains all pipe implementations in order.
    58  // nolint: gochecknoglobals
    59  var Pipeline = append(
    60  	BuildPipeline,
    61  	archive.Pipe{},       // archive in tar.gz, zip or binary (which does no archiving at all)
    62  	sourcearchive.Pipe{}, // archive the source code using git-archive
    63  	nfpm.Pipe{},          // archive via fpm (deb, rpm) using "native" go impl
    64  	snapcraft.Pipe{},     // archive via snapcraft (snap)
    65  	brew.Pipe{},          // create brew tap
    66  	scoop.Pipe{},         // create scoop buckets
    67  	checksums.Pipe{},     // checksums of the files
    68  	sign.Pipe{},          // sign artifacts
    69  	docker.Pipe{},        // create and push docker images
    70  	publish.Pipe{},       // publishes artifacts
    71  	announce.Pipe{},      // announce releases
    72  )