1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/internal/pipeline/pipeline.go
Carlos Alexandro Becker 8306b946d3
feat: initial proxy build support (#2129)
* feat: allow to use ModulePath on templates

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: initial proxy build support

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: build

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: main check

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: make it more flexible

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: small improvements

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: copy go.sum

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: root mod proxy

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: snapshots

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: proxy main pkg

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: environment variables

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: added some tests to go mod proxy feature

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: improve test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: linte

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: goreleaser.yml

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: simplify tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: test build

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: revert unwanted changes

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: allow to run when no mod.suym

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* docs: example

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: not a go module on go 1.15

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* docs: improve docs as per comments

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-03-30 21:06:25 -03:00

67 lines
2.7 KiB
Go

// Package pipeline provides generic erros for pipes to use.
package pipeline
import (
"fmt"
"github.com/goreleaser/goreleaser/internal/pipe/gomod"
"github.com/goreleaser/goreleaser/internal/pipe/semver"
"github.com/goreleaser/goreleaser/internal/pipe/sourcearchive"
"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"
"github.com/goreleaser/goreleaser/internal/pipe/publish"
"github.com/goreleaser/goreleaser/internal/pipe/sign"
"github.com/goreleaser/goreleaser/internal/pipe/snapcraft"
"github.com/goreleaser/goreleaser/internal/pipe/snapshot"
"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
}
// 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
before.Pipe{}, // run global hooks before build
defaults.Pipe{}, // load default configs
snapshot.Pipe{}, // snapshot version handling
dist.Pipe{}, // ensure ./dist is clean
gomod.Pipe{}, // setup gomod-related stuff
effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist
changelog.Pipe{}, // builds the release changelog
build.Pipe{}, // build
}
// Pipeline contains all pipe implementations in order.
// 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
)