feat: improve returned recordings and expand OS compatibility
- Add new formula `act_runner-head.rb` for Gitea runner based on act with `main` version - Add new formula `act_runner.rb` for Gitea runner based on act with version `0.1.4` - Update `bump_version.sh` to include `act_runner` in the binaries list Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
ee1a788402
commit
b03e6c9be0
|
@ -0,0 +1,47 @@
|
|||
require_relative './utils/macos_codesign.rb'
|
||||
|
||||
class ActRunnerHead < Formula
|
||||
desc "A runner for Gitea based on act"
|
||||
homepage "https://gitea.com/gitea/act_runner"
|
||||
version "main"
|
||||
|
||||
os = OS.mac? ? "darwin" : "linux"
|
||||
arch = case Hardware::CPU.arch
|
||||
when :i386 then "386"
|
||||
when :x86_64 then "amd64"
|
||||
when :arm64 then "arm64"
|
||||
else
|
||||
raise "act_runner: Unsupported system architecture #{Hardware::CPU.arch}"
|
||||
end
|
||||
|
||||
@@filename = "act_runner-#{version}-#{os}-#{arch}"
|
||||
@@url = "https://dl.gitea.com/act_runner/#{version}/#{@@filename}"
|
||||
@@using = :nounzip
|
||||
|
||||
if os == "darwin" || arch == "amd64"
|
||||
@@url += ".xz"
|
||||
@@using = nil
|
||||
depends_on "xz"
|
||||
end
|
||||
|
||||
@@sha256 = %x[ curl -sL #{@@url}.sha256 ].split.first
|
||||
|
||||
sha256 @@sha256
|
||||
url @@url,
|
||||
using: @@using
|
||||
|
||||
conflicts_with "act_runner", because: "both install act_runner binaries"
|
||||
def install
|
||||
if stable.using.blank?
|
||||
filename = ActRunnerHead.class_variable_get("@@filename")
|
||||
else
|
||||
filename = downloader.cached_location
|
||||
end
|
||||
apply_ad_hoc_signature(filename)
|
||||
bin.install filename => "act_runner"
|
||||
end
|
||||
|
||||
test do
|
||||
system "#{bin}/act_runner", "--version"
|
||||
end
|
||||
end
|
|
@ -0,0 +1,55 @@
|
|||
require_relative './utils/macos_codesign.rb'
|
||||
|
||||
class ActRunner < Formula
|
||||
desc "A runner for Gitea based on act"
|
||||
homepage "https://gitea.com/gitea/act_runner"
|
||||
version "0.1.4"
|
||||
|
||||
os = OS.mac? ? "darwin" : "linux"
|
||||
arch = case Hardware::CPU.arch
|
||||
when :i386 then "386"
|
||||
when :x86_64 then "amd64"
|
||||
when :arm64 then "arm64"
|
||||
else
|
||||
raise "act_runner: Unsupported system architecture #{Hardware::CPU.arch}"
|
||||
end
|
||||
|
||||
@@filename = "act_runner-#{version}-#{os}-#{arch}"
|
||||
@@url = "https://dl.gitea.com/act_runner/#{version}/#{@@filename}"
|
||||
@@using = :nounzip
|
||||
|
||||
if os == "darwin" || arch == "amd64"
|
||||
@@url += ".xz"
|
||||
@@using = nil
|
||||
depends_on "xz"
|
||||
end
|
||||
|
||||
@@sha256 = case "#{os}-#{arch}"
|
||||
when "linux-386" then "f0d0080db67403bb872a3ff71d77f56f2fc38d95d1e72796e5e85fce4f2a7692" # binary
|
||||
when "linux-amd64" then "32ed8217e7facc718f45d272d8549ad3d2f82735855cc25bfca525c8f72a4d8d"
|
||||
when "linux-arm64" then "be1aa529ca50dfad520206c21ee9c8b179482c11c4f462ddcfa0101d798fbaea" # binary
|
||||
when "darwin-amd64" then "96b5696bc1fa3b65292ac3ac36809e1466df574c3537bd6b0d905ebadeae67bd"
|
||||
when "darwin-arm64" then "fb5e295f901837aa6290942bad5cfd7f12fd218fbce8501e0f3f63807faae236"
|
||||
else
|
||||
raise "act_runner: Unsupported system #{os}-#{arch}"
|
||||
end
|
||||
|
||||
sha256 @@sha256
|
||||
url @@url,
|
||||
using: @@using
|
||||
|
||||
conflicts_with "act_runner-head", because: "both install act_runner binaries"
|
||||
def install
|
||||
if stable.using.blank?
|
||||
filename = ActRunner.class_variable_get("@@filename")
|
||||
else
|
||||
filename = downloader.cached_location
|
||||
end
|
||||
apply_ad_hoc_signature(filename)
|
||||
bin.install filename => "act_runner"
|
||||
end
|
||||
|
||||
test do
|
||||
system "#{bin}/act_runner", "--version"
|
||||
end
|
||||
end
|
|
@ -1,12 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
binaries="tea gitea"
|
||||
binaries="tea act_runner gitea"
|
||||
for bin in ${binaries};do
|
||||
file="${bin}.rb"
|
||||
case "$bin" in
|
||||
tea)
|
||||
git_url="https://gitea.com/gitea/tea"
|
||||
supported_os="linux-386 linux-amd64 linux-arm64 darwin-amd64 darwin-arm64";;
|
||||
act_runner)
|
||||
git_url="https://gitea.com/gitea/act_runner"
|
||||
supported_os="linux-386 linux-amd64 linux-arm64 darwin-amd64 darwin-arm64";;
|
||||
gitea)
|
||||
git_url="https://github.com/go-gitea/gitea"
|
||||
supported_os="linux-386 linux-amd64 linux-arm64 darwin-10.12-amd64 darwin-10.12-arm64";;
|
||||
|
|
Loading…
Reference in New Issue