Skip to content

Commit 6d9b5a8

Browse files
committed
ci: 新增ci发布到brew
1 parent 9c4980a commit 6d9b5a8

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ jobs:
2323
args: release --rm-dist
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
# Token for homebrew-tap repo: https://github.com/gclm/homebrew-tap
27+
HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}

.goreleaser.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,37 @@ changelog:
3131
- '^docs:'
3232
- '^test:'
3333

34+
brews:
35+
- name: ghp
36+
tap:
37+
owner: gclm
38+
name: homebrew-tap
39+
token: "{{ .Env.HOMEBREW_TOKEN }}"
40+
41+
url_template: "https://github.com/gclm/ghp/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
42+
# Git author used to commit to the repository.
43+
# Defaults are shown.
44+
commit_author:
45+
name: gclm
46+
email: gclmit@163.com
47+
homepage: "https://blog.gclmit.club"
48+
description: "Github Proxy | Github 代理"
49+
50+
# Packages your package depends on.
51+
dependencies:
52+
- name: git
53+
54+
# So you can `brew test` your formula.
55+
# Default is empty.
56+
test: |
57+
system "#{bin}/ghp curl https://raw.githubusercontent.com/gclm/homebrew-tap/note/README.md"
58+
# Custom install script for brew.
59+
# Default is 'bin.install "program"'.
60+
install: |
61+
bin.install "ghp"
62+
# Install bash completion
63+
output = Utils.safe_popen_read("#{bin}/ghp", "completion", "bash")
64+
(bash_completion/"ghp").write output
65+
# Install zsh completion
66+
output = Utils.safe_popen_read("#{bin}/ghp", "completion", "zsh")
67+
(zsh_completion/"_ghp").write output

0 commit comments

Comments
 (0)