From 8599fc11acfd0af86fba35a015ce7cfd9221a3b4 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Thu, 6 Oct 2022 15:21:45 -0300 Subject: [PATCH] refactor: improve mergeability Signed-off-by: Carlos A Becker --- internal/pipeline/pipeline.go | 87 +++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/internal/pipeline/pipeline.go b/internal/pipeline/pipeline.go index 8373ea6ec07..8709a0fb74e 100644 --- a/internal/pipeline/pipeline.go +++ b/internal/pipeline/pipeline.go @@ -46,20 +46,34 @@ type Piper interface { // BuildPipeline contains all build-related pipe implementations in order. // nolint:gochecknoglobals var BuildPipeline = []Piper{ - env.Pipe{}, // load and validate environment variables - git.Pipe{}, // get and validate git repo state - semver.Pipe{}, // parse current tag to a semver - defaults.Pipe{}, // load default configs - before.Pipe{}, // run global hooks before build - snapshot.Pipe{}, // snapshot version handling - dist.Pipe{}, // ensure ./dist is clean - gomod.Pipe{}, // setup gomod-related stuff - prebuild.Pipe{}, // run prebuild stuff - gomod.ProxyPipe{}, // proxy gomod if needed - effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist - changelog.Pipe{}, // builds the release changelog - build.Pipe{}, // build - universalbinary.Pipe{}, // universal binary handling + // load and validate environment variables + env.Pipe{}, + // get and validate git repo state + git.Pipe{}, + // parse current tag to a semver + semver.Pipe{}, + // load default configs + defaults.Pipe{}, + // run global hooks before build + before.Pipe{}, + // snapshot version handling + snapshot.Pipe{}, + // ensure ./dist is clean + dist.Pipe{}, + // setup gomod-related stuff + gomod.Pipe{}, + // run prebuild stuff + prebuild.Pipe{}, + // proxy gomod if needed + gomod.ProxyPipe{}, + // writes the actual config (with defaults et al set) to dist + effectiveconfig.Pipe{}, + // builds the release changelog + changelog.Pipe{}, + // build + build.Pipe{}, + // universal binary handling + universalbinary.Pipe{}, } // BuildCmdPipeline is the pipeline run by goreleaser build. @@ -70,19 +84,34 @@ var BuildCmdPipeline = append(BuildPipeline, metadata.Pipe{}) // 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) - sbom.Pipe{}, // create SBOMs of artifacts - checksums.Pipe{}, // checksums of the files - sign.Pipe{}, // sign artifacts - aur.Pipe{}, // create arch linux aur pkgbuild - brew.Pipe{}, // create brew tap - krew.Pipe{}, // krew plugins - scoop.Pipe{}, // create scoop buckets - docker.Pipe{}, // create and push docker images - metadata.Pipe{}, // creates a metadata.json and an artifacts.json files in the dist folder - publish.Pipe{}, // publishes artifacts - announce.Pipe{}, // announce releases + // archive in tar.gz, zip or binary (which does no archiving at all) + archive.Pipe{}, + // archive the source code using git-archive + sourcearchive.Pipe{}, + // archive via fpm (deb, rpm) using "native" go impl + nfpm.Pipe{}, + // archive via snapcraft (snap) + snapcraft.Pipe{}, + // create SBOMs of artifacts + sbom.Pipe{}, + // checksums of the files + checksums.Pipe{}, + // sign artifacts + sign.Pipe{}, + // create arch linux aur pkgbuild + aur.Pipe{}, + // create brew tap + brew.Pipe{}, + // krew plugins + krew.Pipe{}, + // create scoop buckets + scoop.Pipe{}, + // create and push docker images + docker.Pipe{}, + // creates a metadata.json and an artifacts.json files in the dist folder + metadata.Pipe{}, + // publishes artifacts + publish.Pipe{}, + // announce releases + announce.Pipe{}, )