Skip to content

Commit cfcecb2

Browse files
committed
build(goreleaser): add homebrew_casks alongside formula
Migrate the deprecated brews-only setup to also emit a Homebrew cask via homebrew_casks, while keeping the formula in Formula/. The cask strips the com.apple.quarantine xattr post-install so the CLI runs without Gatekeeper prompts. Also clear pre-existing deprecations: pin version 2, rename snapshot.name_template -> version_template and format_overrides.format -> formats.
1 parent 9b21ebd commit cfcecb2

3 files changed

Lines changed: 29 additions & 11 deletions

File tree

.goreleaser.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
before:
23
hooks:
34
- go mod tidy
@@ -27,7 +28,7 @@ archives:
2728
{{- if .Arm }}v{{ .Arm }}{{ end }}
2829
format_overrides:
2930
- goos: windows
30-
format: zip
31+
formats: [zip]
3132
files:
3233
- README.md
3334
- LICENSE
@@ -37,9 +38,10 @@ archives:
3738
checksum:
3839
name_template: "checksums.txt"
3940
snapshot:
40-
name_template: "{{ .Tag }}-next"
41+
version_template: "{{ .Tag }}-next"
4142
brews:
4243
- name: ismc
44+
directory: Formula
4345
repository:
4446
owner: dkorunic
4547
name: homebrew-tap
@@ -50,3 +52,19 @@ brews:
5052
system "#{bin}/iSMC", "help"
5153
install: |
5254
bin.install "iSMC"
55+
homebrew_casks:
56+
- name: ismc
57+
binaries: [iSMC]
58+
repository:
59+
owner: dkorunic
60+
name: homebrew-tap
61+
homepage: https://github.com/dkorunic/iSMC
62+
description: Apple SMC CLI tool that can decode and display temperature, fans, battery, power, voltage and current information
63+
license: GPL-3.0
64+
# Remove the macOS quarantine attribute so the CLI runs without Gatekeeper prompts
65+
hooks:
66+
post:
67+
install: |
68+
if system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
69+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/iSMC"]
70+
end

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ require (
1414
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
1515
github.com/davecgh/go-spew v1.1.1 // indirect
1616
github.com/pmezard/go-difflib v1.0.0 // indirect
17-
golang.org/x/text v0.37.0 // indirect
17+
golang.org/x/text v0.38.0 // indirect
1818
gopkg.in/yaml.v3 v3.0.1 // indirect
1919
)
2020

2121
require (
2222
github.com/inconshreveable/mousetrap v1.1.0 // indirect
23-
github.com/jedib0t/go-pretty/v6 v6.8.0
23+
github.com/jedib0t/go-pretty/v6 v6.8.1
2424
github.com/mattn/go-runewidth v0.0.24 // indirect
2525
github.com/spf13/pflag v1.0.10 // indirect
2626
github.com/stretchr/testify v1.11.1
27-
golang.org/x/sys v0.45.0 // indirect
27+
golang.org/x/sys v0.46.0 // indirect
2828
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQ
77
github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
88
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
99
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
10-
github.com/jedib0t/go-pretty/v6 v6.8.0 h1:fQOTjATVQl5RhssBro6ZuHANFybCkmJ7FjYPo4b7sEY=
11-
github.com/jedib0t/go-pretty/v6 v6.8.0/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
10+
github.com/jedib0t/go-pretty/v6 v6.8.1 h1:0fkCNhjrX0zPpwkWaDYU5VMrygg41Tu197mWILIJoqQ=
11+
github.com/jedib0t/go-pretty/v6 v6.8.1/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
1212
github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU=
1313
github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
1414
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -22,10 +22,10 @@ github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3A
2222
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
2323
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
2424
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
25-
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
26-
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
27-
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
28-
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
25+
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
26+
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
27+
golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
28+
golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4=
2929
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
3030
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3131
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)