mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
renamed archives to binaries, pointed more changes
This commit is contained in:
parent
45a24a1101
commit
7d01a5a8a4
@ -27,7 +27,7 @@ type Context struct {
|
||||
Config config.Project
|
||||
Token string
|
||||
Git GitInfo
|
||||
Archives map[string]string
|
||||
Binaries map[string]string
|
||||
Artifacts []string
|
||||
ReleaseNotes string
|
||||
Version string
|
||||
@ -49,11 +49,12 @@ func (ctx *Context) AddArtifact(file string) {
|
||||
log.WithField("artifact", file).Info("registered")
|
||||
}
|
||||
|
||||
func (ctx *Context) AddArchive(key, file string) {
|
||||
// AddBinary adds a built binary to the current context
|
||||
func (ctx *Context) AddBinary(key, file string) {
|
||||
archiveLock.Lock()
|
||||
defer archiveLock.Unlock()
|
||||
ctx.Archives[key] = file
|
||||
log.WithField("key", key).WithField("archive", file).Info("added")
|
||||
ctx.Binaries[key] = file
|
||||
log.WithField("key", key).WithField("binary", file).Info("added")
|
||||
}
|
||||
|
||||
// New context
|
||||
|
@ -27,7 +27,8 @@ func (Pipe) Description() string {
|
||||
// Run the pipe
|
||||
func (Pipe) Run(ctx *context.Context) error {
|
||||
var g errgroup.Group
|
||||
for platform, archive := range ctx.Archives {
|
||||
// TODO: fix here
|
||||
for platform, archive := range ctx.Binaries {
|
||||
archive := archive
|
||||
platform := platform
|
||||
g.Go(func() error {
|
||||
|
@ -135,7 +135,8 @@ func doBuildFormula(data templateData) (bytes.Buffer, error) {
|
||||
}
|
||||
|
||||
func hasDarwinBuilds(ctx *context.Context) bool {
|
||||
for key := range ctx.Archives {
|
||||
// TODO: fix here
|
||||
for key := range ctx.Binaries {
|
||||
if strings.HasSuffix(key, "darwinamd64") {
|
||||
return true
|
||||
}
|
||||
|
@ -44,11 +44,13 @@ func (Pipe) Run(ctx *context.Context) error {
|
||||
for _, build := range ctx.Config.Builds {
|
||||
for _, goarch := range build.Goarch {
|
||||
var key = build.Binary + "linux" + goarch
|
||||
if ctx.Archives[key] == "" {
|
||||
// TODO: fix here
|
||||
if ctx.Binaries[key] == "" {
|
||||
continue
|
||||
}
|
||||
format := format
|
||||
archive := ctx.Archives[key]
|
||||
// TODO: fix here
|
||||
archive := ctx.Binaries[key]
|
||||
arch := goarchToUnix[goarch]
|
||||
g.Go(func() error {
|
||||
return create(ctx, format, archive, arch)
|
||||
|
Loading…
x
Reference in New Issue
Block a user