Rui Chen
6eaa69b988
Same to tea, we have incorporated gitea into homebrew-core as well. (PR, https://github.com/Homebrew/homebrew-core/pull/141302). I think we can just transition to core. Thanks! This is the formula page, https://formulae.brew.sh/formula/gitea Reviewed-on: #178 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Rui Chen <rui@chenrui.dev> Co-committed-by: Rui Chen <rui@chenrui.dev>
27 lines
851 B
Bash
Executable File
27 lines
851 B
Bash
Executable File
#!/bin/sh
|
|
|
|
binaries="act_runner"
|
|
for bin in ${binaries};do
|
|
file="${bin}.rb"
|
|
case "$bin" in
|
|
act_runner)
|
|
git_url="https://gitea.com/gitea/act_runner"
|
|
supported_os="linux-amd64 linux-arm64 darwin-amd64 darwin-arm64";;
|
|
*)
|
|
>&2 echo "Error: unrecognized binary ($bin)"
|
|
exit 1;;
|
|
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
|
|
sha256_file="${bin}-${version}-${os}.xz.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}"
|
|
done
|