Skip to content

Commit 523de8b

Browse files
authored
Upgrade to use goreleaser cask (#381)
* Upgrade to use goreleaser cask * add completions
1 parent 90d94b3 commit 523de8b

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

.goreleaser.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ builds:
2424
- -X github.com/j178/leetgo/constants.BuildDate={{.Date}}
2525

2626
archives:
27-
- format: tar.gz
27+
- formats: ['tar.gz']
2828
# this name template makes the OS and Arch compatible with the results of uname.
2929
name_template: >-
3030
{{ .ProjectName }}_
@@ -37,7 +37,7 @@ archives:
3737
# use zip for windows archives
3838
format_overrides:
3939
- goos: windows
40-
format: zip
40+
formats: ['zip']
4141
files:
4242
- LICENSE
4343
- README*
@@ -63,26 +63,30 @@ changelog:
6363
- '^docs:'
6464
- '^test:'
6565
- '(?i)^Minor'
66-
brews:
66+
homebrew_casks:
6767
- repository:
6868
owner: j178
6969
name: homebrew-tap
70+
conflicts:
71+
- formula: leetgo
7072
commit_author:
7173
name: goreleaserbot
7274
email: bot@goreleaser.com
73-
directory: Formula
7475
homepage: https://github.com/j178/leetgo
7576
description: >-
7677
leetgo is a command line tool for leetcode.com. It can help you to login,
7778
submit, test, and view your submissions.
7879
license: MIT
79-
install: |-
80-
bin.install "leetgo"
81-
bash_completion.install "completions/leetgo.bash" => "leetgo"
82-
zsh_completion.install "completions/leetgo.zsh" => "_leetgo"
83-
fish_completion.install "completions/leetgo.fish"
84-
test: |-
85-
system "#{bin}/leetgo", "-v"
80+
completions:
81+
bash: completions/leetgo.bash
82+
zsh: completions/leetgo.zsh
83+
fish: completions/leetgo.fish
84+
hooks:
85+
post:
86+
install: |
87+
if system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
88+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/leetgo"]
89+
end
8690
8791
scoops:
8892
- repository:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ You can download the latest binary from the [release page](https://github.com/j1
112112
### Install via [HomeBrew](https://brew.sh/) on macOS/Linux
113113

114114
```shell
115-
brew install j178/tap/leetgo
115+
brew install --cask j178/tap/leetgo
116116
```
117117

118118
### Install via [Scoop](https://scoop.sh/) on Windows

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func main() {
109109
### macOS/Linux 使用 [HomeBrew](https://brew.sh/)
110110

111111
```shell
112-
brew install j178/tap/leetgo
112+
brew install --cask j178/tap/leetgo
113113
```
114114

115115
### Windows 使用 [Scoop](https://scoop.sh/)

0 commit comments

Comments
 (0)