You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-11-29 23:07:42 +02:00
fail brew pipe if there is no darwin_amd64 build
This commit is contained in:
@@ -2,6 +2,7 @@ package brew
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"log"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -13,6 +14,10 @@ import (
|
||||
"github.com/goreleaser/goreleaser/sha256sum"
|
||||
)
|
||||
|
||||
// ErrNoDarwin64Build when there is no build for darwin_amd64 (goos doesn't
|
||||
// contain darwin and/or goarch doesn't contain amd64)
|
||||
var ErrNoDarwin64Build = errors.New("brew tap requires a darwin amd64 build")
|
||||
|
||||
const formulae = `class {{ .Name }} < Formula
|
||||
desc "{{ .Desc }}"
|
||||
homepage "{{ .Homepage }}"
|
||||
@@ -112,6 +117,9 @@ func dataFor(ctx *context.Context, client *github.Client) (result templateData,
|
||||
return
|
||||
}
|
||||
file := ctx.Archives["darwinamd64"]
|
||||
if file == "" {
|
||||
return result, ErrNoDarwin64Build
|
||||
}
|
||||
sum, err := sha256sum.For("dist/" + file + "." + ctx.Config.Archive.Format)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user