File tree 2 files changed +34
-1
lines changed
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,34 @@ brews:
63
63
folder : Formula
64
64
homepage : https://github.com/twitchdev/twitch-cli
65
65
description : CLI for Twitch's developer offerings
66
+ custom_block : |
67
+ if OS.mac? && Hardware::CPU.arm?
68
+ url "https://github.com/twitchdev/twitch-cli.git", tag: "{{ .Tag }}"
69
+ depends_on "go" => :build
70
+ end
71
+
72
+ head "https://github.com/twitchdev/twitch-cli.git", branch: "main"
73
+ head do
74
+ depends_on "go" => :build
75
+ end
66
76
install : |
77
+ v = version
78
+ if build.head?
79
+ v = "head"
80
+ ldflags = "-X main.buildVersion=#{v}"
81
+ system "go", "build", "-ldflags=#{ldflags}"
82
+ mv "twitch-cli", "twitch"
83
+ end
84
+
85
+ if OS.mac? && Hardware::CPU.arm?
86
+ ldflags = "-X main.buildVersion=#{v}"
87
+ system "go", "build", "-ldflags=#{ldflags}"
88
+ mv "twitch-cli", "twitch"
89
+ end
90
+
67
91
bin.install "twitch"
68
92
test : |
69
- system "#{bin}/twitch -v "
93
+ system "#{bin}/twitch", "version "
70
94
license : Apache-2.0
71
95
archives :
72
96
- replacements :
Original file line number Diff line number Diff line change @@ -7,6 +7,15 @@ release:
7
7
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
8
8
twitch-cli:latest --rm-dist
9
9
10
+ test-release :
11
+ docker build . -t twitch-cli:latest
12
+ docker run --rm --privileged \
13
+ -v $$ PWD:/go/src/github.com/twitchdev/twitch-cli \
14
+ -v /var/run/docker.sock:/var/run/docker.sock \
15
+ -w /go/src/github.com/twitchdev/twitch-cli \
16
+ -e GITHUB_TOKEN=${GITHUB_TOKEN} \
17
+ twitch-cli:latest --rm-dist --skip-publish --snapshot
18
+
10
19
build :
11
20
go build --ldflags " -X main.buildVersion=source"
12
21
You can’t perform that action at this time.
0 commit comments