mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-31 01:53:50 +02:00
feat: allow to specify version of brew deps (#3319)
* feat: add version for homebrew dependencies * resolve conflicts * resolve conflicts * feat: allow to specify version of brew deps Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> * docs: brew Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> Co-authored-by: Purushotham <purushotham@hasura.io>
This commit is contained in:
parent
dcd402c013
commit
6d000e5cb1
@ -268,16 +268,20 @@ func TestFullPipe(t *testing.T) {
|
||||
IDs: []string{
|
||||
"foo",
|
||||
},
|
||||
Description: "Run pipe test formula and FOO={{ .Env.FOO }}",
|
||||
Caveats: "don't do this {{ .ProjectName }}",
|
||||
Test: "system \"true\"\nsystem \"#{bin}/foo\", \"-h\"",
|
||||
Plist: `<xml>whatever</xml>`,
|
||||
Dependencies: []config.HomebrewDependency{{Name: "zsh", Type: "optional"}, {Name: "bash"}},
|
||||
Conflicts: []string{"gtk+", "qt"},
|
||||
Service: "run foo/bar\nkeep_alive true",
|
||||
PostInstall: "system \"echo\"\ntouch \"/tmp/hi\"",
|
||||
Install: `bin.install "{{ .ProjectName }}"`,
|
||||
Goamd64: "v1",
|
||||
Description: "Run pipe test formula and FOO={{ .Env.FOO }}",
|
||||
Caveats: "don't do this {{ .ProjectName }}",
|
||||
Test: "system \"true\"\nsystem \"#{bin}/foo\", \"-h\"",
|
||||
Plist: `<xml>whatever</xml>`,
|
||||
Dependencies: []config.HomebrewDependency{
|
||||
{Name: "zsh", Type: "optional"},
|
||||
{Name: "bash", Version: "3.2.57"},
|
||||
{Name: "fish", Type: "optional", Version: "v1.2.3"},
|
||||
},
|
||||
Conflicts: []string{"gtk+", "qt"},
|
||||
Service: "run foo/bar\nkeep_alive true",
|
||||
PostInstall: "system \"echo\"\ntouch \"/tmp/hi\"",
|
||||
Install: `bin.install "{{ .ProjectName }}"`,
|
||||
Goamd64: "v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -48,7 +48,7 @@ class {{ .Name }} < Formula
|
||||
{{- with .Dependencies }}
|
||||
{{ range $index, $element := . }}
|
||||
depends_on "{{ .Name }}"
|
||||
{{- if .Type }} => :{{ .Type }}{{- end }}
|
||||
{{- if .Type }} => :{{ .Type }}{{- else if .Version }} => "{{ .Version }}"{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
|
@ -8,7 +8,8 @@ class CustomBlock < Formula
|
||||
version "1.0.1"
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
depends_on "bash"
|
||||
depends_on "bash" => "3.2.57"
|
||||
depends_on "fish" => :optional
|
||||
depends_on :macos
|
||||
|
||||
on_macos do
|
||||
|
@ -8,7 +8,8 @@ class CustomDownloadStrategy < Formula
|
||||
version "1.0.1"
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
depends_on "bash"
|
||||
depends_on "bash" => "3.2.57"
|
||||
depends_on "fish" => :optional
|
||||
depends_on :macos
|
||||
|
||||
on_macos do
|
||||
|
@ -9,7 +9,8 @@ class CustomRequire < Formula
|
||||
version "1.0.1"
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
depends_on "bash"
|
||||
depends_on "bash" => "3.2.57"
|
||||
depends_on "fish" => :optional
|
||||
depends_on :macos
|
||||
|
||||
on_macos do
|
||||
|
@ -8,7 +8,8 @@ class Default < Formula
|
||||
version "1.0.1"
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
depends_on "bash"
|
||||
depends_on "bash" => "3.2.57"
|
||||
depends_on "fish" => :optional
|
||||
depends_on :macos
|
||||
|
||||
on_macos do
|
||||
|
@ -8,7 +8,8 @@ class DefaultGitlab < Formula
|
||||
version "1.0.1"
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
depends_on "bash"
|
||||
depends_on "bash" => "3.2.57"
|
||||
depends_on "fish" => :optional
|
||||
depends_on :macos
|
||||
|
||||
on_macos do
|
||||
|
@ -8,7 +8,8 @@ class ValidTapTemplates < Formula
|
||||
version "1.0.1"
|
||||
|
||||
depends_on "zsh" => :optional
|
||||
depends_on "bash"
|
||||
depends_on "bash" => "3.2.57"
|
||||
depends_on "fish" => :optional
|
||||
depends_on :macos
|
||||
|
||||
on_macos do
|
||||
|
@ -82,8 +82,9 @@ type RepoRef struct {
|
||||
|
||||
// HomebrewDependency represents Homebrew dependency.
|
||||
type HomebrewDependency struct {
|
||||
Name string `yaml:"name,omitempty" json:"name,omitempty"`
|
||||
Type string `yaml:"type,omitempty" json:"type,omitempty"`
|
||||
Name string `yaml:"name,omitempty" json:"name,omitempty"`
|
||||
Type string `yaml:"type,omitempty" json:"type,omitempty"`
|
||||
Version string `yaml:"version,omitempty" json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// type alias to prevent stack overflowing in the custom unmarshaler.
|
||||
|
@ -113,6 +113,13 @@ brews:
|
||||
- name: git
|
||||
- name: zsh
|
||||
type: optional
|
||||
- name: fish
|
||||
version: v1.2.3
|
||||
# if providing both version and type, only the type will be taken into account.
|
||||
- name: elvish
|
||||
type: optional
|
||||
version: v1.2.3
|
||||
|
||||
|
||||
# Packages that conflict with your package.
|
||||
conflicts:
|
||||
|
Loading…
Reference in New Issue
Block a user