homebrew-gitea/changelog.rb
markkrj 05af00386a Make changelog match new shipping method (#137)
I forgot about this one on !136 😅️

Also, fix #134. And I think you may close #108, as I'm writing and testing using Linuxbrew.

Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: gitea/homebrew-gitea#137
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-07-04 17:35:15 +08:00

32 lines
843 B
Ruby

class Changelog < Formula
desc "Generate changelog of gitea repository"
homepage "https://gitea.com/gitea/changelog"
version "master"
os = OS.mac? ? "darwin-10.6" : "linux"
arch = case Hardware::CPU.arch
when :i386 then "386"
when :x86_64 then "amd64"
when :arm64 then "arm64"
else
raise "changelog: Unsupported system architecture #{Hardware::CPU.arch}"
end
@@filename = "changelog-#{version}-#{os}-#{arch}"
@@url = "https://dl.gitea.io/changelog-tool/#{version}/#{@@filename}.xz"
@@sha256 = %x[ curl -sL #{@@url}.sha256 ].split.first
url @@url
sha256 @@sha256
bottle :unneeded
def install
filename = Changelog.class_variable_get("@@filename")
bin.install filename => "changelog"
end
test do
system "#{bin}/changelog", "--version"
end
end