Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
2023-09-14 11:07:30 +05:30
|
|
|
binaries="act_runner"
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
for bin in ${binaries};do
|
|
|
|
file="${bin}.rb"
|
|
|
|
case "$bin" in
|
2023-05-03 07:24:40 +05:30
|
|
|
act_runner)
|
|
|
|
git_url="https://gitea.com/gitea/act_runner"
|
|
|
|
supported_os="linux-amd64 linux-arm64 darwin-amd64 darwin-arm64";;
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
*)
|
|
|
|
>&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}"
|
2023-05-03 07:24:40 +05:30
|
|
|
echo "update ${bin} version: ${version}"
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
|
2023-04-21 19:16:03 +05:30
|
|
|
file_url="https://dl.gitea.com/${bin}/${version}"
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
for os in ${supported_os}; do
|
2023-05-04 15:59:38 +05:30
|
|
|
sha256_file="${bin}-${version}-${os}.xz.sha256"
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
sha256=$(curl -sL "${file_url}/${sha256_file}" | awk '{print$1}')
|
2023-05-03 07:24:40 +05:30
|
|
|
echo "update ${bin} os: ${os}, sha256: ${sha256}"
|
2021-10-12 23:24:46 +05:30
|
|
|
sed -r "s/^(\s+when \"${os}\" then).*\"(.*)$/\1 \"${sha256}\"\2/" -i "${file}"
|
Fix homebrew tap by removing head and shipping compiled binaries (#136)
fixes #135
This fix Homebrew tap by removing the head method and shipping only pre-compiled binaries, as you guys already ship binaries for most (all?) supported platforms.
Also, for gitea.rb and tea.rb, I removed the curl for fetching files checksum, because for every install, it runs `curl` 5 times, slowing the install. So, I created a script to bump versions to latest and fix sha256 checksum in the formula files.
I created also an gitea-head and tea-head formulae to download latest pre-compiled binaries for head, and here we are fetching checksum by `curl`, as I imagine, it is not common/recommended scenario.
IMO, this is the best possible approach for shipping binaries from a custom tap.
Co-authored-by: Marcos de Oliveira <markinholiveira@gmail.com>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/136
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: markkrj <markkrj@noreply.gitea.io>
Co-committed-by: markkrj <markkrj@noreply.gitea.io>
2021-06-29 23:30:18 +05:30
|
|
|
done
|
|
|
|
sed -r "s/^(\s+version).*/\1 \"${version}\"/" -i "${file}"
|
|
|
|
done
|