github.com/goreleaser/goreleaser@v1.25.1/internal/pipe/brew/templates/macos_packages.rb (about)

     1  {{- define "macos_packages" }}
     2  {{- range $element := .MacOSPackages }}
     3    {{- if eq $element.Arch "all" }}
     4    url "{{ $element.DownloadURL }}"
     5    {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }}
     6    {{- if .Headers }},
     7      headers: [{{ printf "\n" }}
     8        {{- join .Headers | indent 8 }}
     9      ]
    10    {{- end }}
    11    sha256 "{{ $element.SHA256 }}"
    12  
    13    def install
    14      {{- range $index, $element := .Install }}
    15      {{ . -}}
    16      {{- end }}
    17    end
    18    {{- else if $.HasOnlyAmd64MacOsPkg }}
    19    url "{{ $element.DownloadURL }}"
    20    {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }}
    21    {{- if .Headers }},
    22      headers: [{{ printf "\n" }}
    23        {{- join .Headers | indent 8 }}
    24      ]
    25    {{- end }}
    26    sha256 "{{ $element.SHA256 }}"
    27  
    28    def install
    29      {{- range $index, $element := .Install }}
    30      {{ . -}}
    31      {{- end }}
    32    end
    33  
    34    if Hardware::CPU.arm?
    35      def caveats
    36        <<~EOS
    37          The darwin_arm64 architecture is not supported for the {{ $.Name }}
    38          formula at this time. The darwin_amd64 binary may work in compatibility
    39          mode, but it might not be fully supported.
    40        EOS
    41      end
    42    end
    43    {{- else }}
    44    {{- if eq $element.Arch "amd64" }}
    45    if Hardware::CPU.intel?
    46    {{- end }}
    47    {{- if eq $element.Arch "arm64" }}
    48    if Hardware::CPU.arm?
    49    {{- end}}
    50      url "{{ $element.DownloadURL }}"
    51      {{- if .DownloadStrategy }}, using: {{ .DownloadStrategy }}{{- end }}
    52      {{- if .Headers }},
    53        headers: [{{ printf "\n" }}
    54          {{- join .Headers | indent 8 }}
    55        ]
    56      {{- end }}
    57      sha256 "{{ $element.SHA256 }}"
    58  
    59      def install
    60        {{- range $index, $element := .Install }}
    61        {{ . -}}
    62        {{- end }}
    63      end
    64    end
    65    {{- end }}
    66  {{- end }}
    67  {{- end }}