Add changelog

This commit is contained in:
Lunny Xiao 2020-01-27 11:32:33 +08:00
parent 3f5e907387
commit d007c8938a
No known key found for this signature in database
GPG key ID: C3B7C91B632F738A

46
changelog.rb Normal file
View file

@ -0,0 +1,46 @@
require "formula"
class Changelog < Formula
homepage "https://gitea.com/gitea/changelog"
head "https://gitea.com/gitea/changelog.git"
stable do
version "0.1.0"
url "https://dl.gitea.io/changelog-tool/#{version}/changelog-tool-#{version}-darwin-10.6-amd64"
sha256 `curl -s https://dl.gitea.io/changelog-tool/#{version}/changelog-tool-#{version}-darwin-10.6-amd64.sha256`.split(" ").first
end
devel do
url "https://dl.gitea.io/changelog-tool/master/changelog-tool-master-darwin-10.6-amd64"
sha256 `curl -s https://dl.gitea.io/changelog-tool/master/changelog-tool-master-darwin-10.6-amd64.sha256`.split(" ").first
version "master"
end
head do
url "https://gitea.com/gitea/changelog.git", :branch => "master"
depends_on "go" => :build
end
test do
system "#{bin}/changelog-tool", "--version"
end
def install
case
when build.head?
mkdir_p buildpath/File.join("src", "code.gitea.io")
ln_s buildpath, buildpath/File.join("src", "code.gitea.io", "changelog")
ENV.append_path "PATH", File.join(buildpath, "bin")
ENV["GOPATH"] = buildpath
ENV["GOHOME"] = buildpath
system "cd src/code.gitea.io/changelog && make build"
bin.install "#{buildpath}/changelog" => "changelog-tool"
else
bin.install "#{buildpath}/changelog-tool-#{version}-darwin-10.6-amd64" => "changelog-tool"
end
end
end