-
Notifications
You must be signed in to change notification settings - Fork 0
/
act_runner-head.rb
44 lines (37 loc) · 1.13 KB
/
act_runner-head.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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"
license "MIT"
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}"
@@url += ".xz"
@@using = nil
depends_on "xz"
@@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