2018-03-08 23:46:15 +02:00
|
|
|
// Package pipeline provides generic erros for pipes to use.
|
2016-12-30 13:27:35 +02:00
|
|
|
package pipeline
|
|
|
|
|
2018-09-12 19:18:01 +02:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2021-03-22 13:55:01 +02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/gomod"
|
2019-01-19 20:57:58 +02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/semver"
|
2020-04-12 16:47:46 +02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/sourcearchive"
|
2019-01-19 20:57:58 +02:00
|
|
|
|
2018-09-12 19:18:01 +02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/archive"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/before"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/build"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/changelog"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/checksums"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/defaults"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/dist"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/docker"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/effectiveconfig"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/env"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/git"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/nfpm"
|
2018-10-05 14:22:53 +02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/publish"
|
2018-09-12 19:18:01 +02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/sign"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/snapcraft"
|
2018-12-13 14:09:36 +02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe/snapshot"
|
2018-09-12 19:18:01 +02:00
|
|
|
"github.com/goreleaser/goreleaser/pkg/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Piper defines a pipe, which can be part of a pipeline (a serie of pipes).
|
|
|
|
type Piper interface {
|
|
|
|
fmt.Stringer
|
|
|
|
|
|
|
|
// Run the pipe
|
|
|
|
Run(ctx *context.Context) error
|
2017-08-20 21:35:46 +02:00
|
|
|
}
|
|
|
|
|
2020-11-27 04:16:08 +02:00
|
|
|
// BuildPipeline contains all build-related pipe implementations in order.
|
2020-05-15 16:19:20 +02:00
|
|
|
// nolint:gochecknoglobals
|
|
|
|
var BuildPipeline = []Piper{
|
2019-06-29 16:02:40 +02:00
|
|
|
env.Pipe{}, // load and validate environment variables
|
2018-09-12 19:18:01 +02:00
|
|
|
git.Pipe{}, // get and validate git repo state
|
2019-01-19 20:57:58 +02:00
|
|
|
semver.Pipe{}, // parse current tag to a semver
|
2020-07-30 04:29:31 +02:00
|
|
|
before.Pipe{}, // run global hooks before build
|
2018-11-25 21:30:30 +02:00
|
|
|
defaults.Pipe{}, // load default configs
|
2018-12-13 14:09:36 +02:00
|
|
|
snapshot.Pipe{}, // snapshot version handling
|
2018-11-25 21:30:30 +02:00
|
|
|
dist.Pipe{}, // ensure ./dist is clean
|
2021-03-31 02:06:25 +02:00
|
|
|
gomod.Pipe{}, // setup gomod-related stuff
|
2018-09-12 19:18:01 +02:00
|
|
|
effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist
|
|
|
|
changelog.Pipe{}, // builds the release changelog
|
|
|
|
build.Pipe{}, // build
|
2017-08-20 21:35:46 +02:00
|
|
|
}
|
2020-05-15 16:19:20 +02:00
|
|
|
|
2020-11-27 04:16:08 +02:00
|
|
|
// Pipeline contains all pipe implementations in order.
|
2020-05-15 16:19:20 +02:00
|
|
|
// nolint: gochecknoglobals
|
|
|
|
var Pipeline = append(
|
|
|
|
BuildPipeline,
|
|
|
|
archive.Pipe{}, // archive in tar.gz, zip or binary (which does no archiving at all)
|
|
|
|
sourcearchive.Pipe{}, // archive the source code using git-archive
|
|
|
|
nfpm.Pipe{}, // archive via fpm (deb, rpm) using "native" go impl
|
|
|
|
snapcraft.Pipe{}, // archive via snapcraft (snap)
|
|
|
|
checksums.Pipe{}, // checksums of the files
|
|
|
|
sign.Pipe{}, // sign artifacts
|
|
|
|
docker.Pipe{}, // create and push docker images
|
|
|
|
publish.Pipe{}, // publishes artifacts
|
|
|
|
)
|