1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-04 03:11:55 +02:00
goreleaser/pkg/build/build.go
Carlos Alexandro Becker b0583c700b
feat: support GOAMD64 (#3016)
* feat: support GOAMD64

* fix: test

* wip

* wip: docker et al

* fix: archive format name

* test: added new test

* feat: nfpm amd4, mips et al

* chore: rm unused file

* fix: brew for multiple goamd64

* fix: krew

* feat: aur

* feat: krew

* docs: brew

* feat: gofis

* feat: scoop

* fix: docker filters

* fix: snapcraft

* fix: improve diff a bit

* fix: snapcraft name template
2022-04-11 22:43:22 -03:00

47 lines
951 B
Go

// Package build provides the API for external builders
package build
import (
"sync"
"github.com/goreleaser/goreleaser/pkg/config"
"github.com/goreleaser/goreleaser/pkg/context"
)
// nolint: gochecknoglobals
var (
builders = map[string]Builder{}
lock sync.Mutex
)
// Register registers a builder to a given name.
func Register(name string, builder Builder) {
lock.Lock()
builders[name] = builder
lock.Unlock()
}
// For gets the previously registered builder for the given name.
func For(name string) Builder {
return builders[name]
}
// Options to be passed down to a builder.
type Options struct {
Name string
Path string
Ext string
Target string
Goos string
Goarch string
Goamd64 string
Goarm string
Gomips string
}
// Builder defines a builder.
type Builder interface {
WithDefaults(build config.Build) (config.Build, error)
Build(ctx *context.Context, build config.Build, options Options) error
}