diff --git a/Formula/ghr.rb b/Formula/ghr.rb new file mode 100644 index 0000000000..744e9b4dd1 --- /dev/null +++ b/Formula/ghr.rb @@ -0,0 +1,26 @@ +class Ghr < Formula + desc "Upload multiple artifacts to GitHub Release in parallel" + homepage "https://tcnksm.github.io/ghr" + url "https://github.com/tcnksm/ghr/archive/v0.12.0.tar.gz" + sha256 "d1b95e55fc4e995de7909942dd031cf218fcb6e3ffbad2cdd2c527b34a7dd2bd" + + depends_on "dep" => :build + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + dir = buildpath/"src/github.com/tcnksm/ghr" + dir.install Dir["*"] + cd dir do + system "dep", "ensure", "-vendor-only" + system "go", "build", "-o", bin/"ghr" + prefix.install_metafiles + end + end + + test do + ENV["GITHUB_TOKEN"] = nil + args = "-username testbot -repository #{testpath} v#{version} #{Dir.pwd}" + assert_include "token not found", shell_output("#{bin}/ghr #{args}", 15) + end +end