1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

fix: breaking: remove the build dependencies from the brew pipe

as for now, it just doesnt work, and maybe it doesnt make sense
to have it anyway
This commit is contained in:
Carlos Alexandro Becker 2018-06-20 09:46:42 -03:00 committed by Carlos Alexandro Becker
parent 8d96eef1c7
commit 90656f8550
5 changed files with 47 additions and 68 deletions

View File

@ -35,22 +35,21 @@ func (r Repo) String() string {
// Homebrew contains the brew section
type Homebrew struct {
Name string `yaml:",omitempty"`
GitHub Repo `yaml:",omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty"`
Folder string `yaml:",omitempty"`
Caveats string `yaml:",omitempty"`
Plist string `yaml:",omitempty"`
Install string `yaml:",omitempty"`
Dependencies []string `yaml:",omitempty"`
BuildDependencies []string `yaml:"build_dependencies,omitempty"`
Test string `yaml:",omitempty"`
Conflicts []string `yaml:",omitempty"`
Description string `yaml:",omitempty"`
Homepage string `yaml:",omitempty"`
SkipUpload bool `yaml:"skip_upload,omitempty"`
DownloadStrategy string `yaml:"download_strategy,omitempty"`
SourceTarball string `yaml:"-"`
Name string `yaml:",omitempty"`
GitHub Repo `yaml:",omitempty"`
CommitAuthor CommitAuthor `yaml:"commit_author,omitempty"`
Folder string `yaml:",omitempty"`
Caveats string `yaml:",omitempty"`
Plist string `yaml:",omitempty"`
Install string `yaml:",omitempty"`
Dependencies []string `yaml:",omitempty"`
Test string `yaml:",omitempty"`
Conflicts []string `yaml:",omitempty"`
Description string `yaml:",omitempty"`
Homepage string `yaml:",omitempty"`
SkipUpload bool `yaml:"skip_upload,omitempty"`
DownloadStrategy string `yaml:"download_strategy,omitempty"`
SourceTarball string `yaml:"-"`
}
// Scoop contains the scoop.sh section

View File

@ -165,23 +165,22 @@ func dataFor(ctx *context.Context, client client.Client, artifact artifact.Artif
}
var cfg = ctx.Config.Brew
return templateData{
Name: formulaNameFor(ctx.Config.Brew.Name),
DownloadURL: ctx.Config.GitHubURLs.Download,
Desc: cfg.Description,
Homepage: cfg.Homepage,
Repo: ctx.Config.Release.GitHub,
Tag: ctx.Git.CurrentTag,
Version: ctx.Version,
Caveats: split(cfg.Caveats),
File: artifact.Name,
SHA256: sum,
Dependencies: cfg.Dependencies,
BuildDependencies: cfg.BuildDependencies,
Conflicts: cfg.Conflicts,
Plist: cfg.Plist,
Install: split(cfg.Install),
Tests: split(cfg.Test),
DownloadStrategy: cfg.DownloadStrategy,
Name: formulaNameFor(ctx.Config.Brew.Name),
DownloadURL: ctx.Config.GitHubURLs.Download,
Desc: cfg.Description,
Homepage: cfg.Homepage,
Repo: ctx.Config.Release.GitHub,
Tag: ctx.Git.CurrentTag,
Version: ctx.Version,
Caveats: split(cfg.Caveats),
File: artifact.Name,
SHA256: sum,
Dependencies: cfg.Dependencies,
Conflicts: cfg.Conflicts,
Plist: cfg.Plist,
Install: split(cfg.Install),
Tests: split(cfg.Test),
DownloadStrategy: cfg.DownloadStrategy,
}, nil
}

View File

@ -107,9 +107,6 @@ func TestRunPipe(t *testing.T) {
"custom_download_strategy": func(ctx *context.Context) {
ctx.Config.Brew.DownloadStrategy = "GitHubPrivateRepositoryReleaseDownloadStrategy"
},
"build_from_source": func(ctx *context.Context) {
ctx.Config.Brew.BuildDependencies = []string{"go"}
},
} {
t.Run(name, func(t *testing.T) {
folder, err := ioutil.TempDir("", "goreleasertest")

View File

@ -3,35 +3,29 @@ package brew
import "github.com/goreleaser/goreleaser/config"
type templateData struct {
Name string
Desc string
Homepage string
DownloadURL string
Repo config.Repo // FIXME: will not work for anything but github right now.
Tag string
Version string
Caveats []string
File string
SHA256 string
Plist string
DownloadStrategy string
Install []string
Dependencies []string
BuildDependencies []string
Conflicts []string
Tests []string
Name string
Desc string
Homepage string
DownloadURL string
Repo config.Repo // FIXME: will not work for anything but github right now.
Tag string
Version string
Caveats []string
File string
SHA256 string
Plist string
DownloadStrategy string
Install []string
Dependencies []string
Conflicts []string
Tests []string
}
const formulaTemplate = `class {{ .Name }} < Formula
desc "{{ .Desc }}"
homepage "{{ .Homepage }}"
{{ if .BuildDependencies -}}
url "{{ .DownloadURL }}/{{ .Repo.Owner }}/{{ .Repo.Name }}/archive/{{ .Tag }}.tar.gz"
head "https://github.com/{{ .Repo.Owner }}/{{ .Repo.Name }}.git"
{{- else -}}
url "{{ .DownloadURL }}/{{ .Repo.Owner }}/{{ .Repo.Name }}/releases/download/{{ .Tag }}/{{ .File }}"
{{- if .DownloadStrategy }}, :using => {{ .DownloadStrategy }}{{- end }}
{{- end }}
version "{{ .Version }}"
sha256 "{{ .SHA256 }}"
@ -40,11 +34,6 @@ const formulaTemplate = `class {{ .Name }} < Formula
depends_on "{{ . }}"
{{- end }}
{{- end -}}
{{- with .BuildDependencies -}}
{{ range $index, $element := . }}
depends_on "{{ . }}" => :build
{{- end }}
{{- end -}}
{{- with .Conflicts }}
{{ range $index, $element := . }}

View File

@ -64,11 +64,6 @@ brew:
- git
- zsh
# Packages your source package depends on.
build_dependencies:
- make
- gcc
# Packages that conflict with your package.
conflicts:
- svn