feat: improve returned recordings and expand OS compatibility (#164)
- 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> fix https://gitea.com/gitea/homebrew-gitea/issues/163 Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.io> Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/164 Reviewed-by: silverwind <silverwind@noreply.gitea.io> Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io> Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
cc9f50269c
commit
4bf7c6c832
|
@ -28,5 +28,7 @@ jobs:
|
|||
tea --version
|
||||
brew install gitea/gitea/gitea
|
||||
gitea --version
|
||||
brew install gitea/gitea/act_runner
|
||||
act_runner --version
|
||||
# TODO: test for arm
|
||||
# There is no arm image for homebrew/brew, and the image markkrj/homebrew-arm hasn't been updated for years
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
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}"
|
||||
@@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
|
|
@ -0,0 +1,50 @@
|
|||
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.6"
|
||||
|
||||
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 = case "#{os}-#{arch}"
|
||||
when "linux-amd64" then "54c54dcf9337a7f154ca156269129022babaf5cb44574132c0c4a51e2e4b43ac"
|
||||
when "linux-arm64" then "7dd14455235bbdb3ed6059da137597fcf649f3e48343354601ae6e6214d7603f" # binary
|
||||
when "darwin-amd64" then "db772791ace78e6c821a89b6b3fbadb670ca9c8c0795f9c8ba8dfdd99317fe5e"
|
||||
when "darwin-arm64" then "9970d43e87b78e6ea1132242cefe92fc7c778de98a40c29494b36c441d9e94de"
|
||||
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-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";;
|
||||
|
@ -16,6 +19,7 @@ for bin in ${binaries};do
|
|||
esac
|
||||
latest=$(curl -sL -o /dev/null -w %{url_effective} "${git_url}/releases/latest")
|
||||
version="${latest##*/v}"
|
||||
echo "update ${bin} version: ${version}"
|
||||
|
||||
file_url="https://dl.gitea.com/${bin}/${version}"
|
||||
for os in ${supported_os}; do
|
||||
|
@ -25,6 +29,7 @@ for bin in ${binaries};do
|
|||
fi
|
||||
sha256_file="${sha256_file}.sha256"
|
||||
sha256=$(curl -sL "${file_url}/${sha256_file}" | awk '{print$1}')
|
||||
echo "update ${bin} os: ${os}, sha256: ${sha256}"
|
||||
sed -r "s/^(\s+when \"${os}\" then).*\"(.*)$/\1 \"${sha256}\"\2/" -i "${file}"
|
||||
done
|
||||
sed -r "s/^(\s+version).*/\1 \"${version}\"/" -i "${file}"
|
||||
|
|
Loading…
Reference in New Issue