chore(revert): fix: alternative route of getting latest Gitea version

Revert 53375283d4
fix: alternative route of getting latest Gitea version

Use git ls-remote and git-mirror instead of the API

$ version=1.23
$ git ls-remote --refs --tags --sort=version:refname https://git-mirror.forgejo.org/go-gitea/gitea "v$version*" | sed -n -E -e "s|^.*/v($version[\.0-9]*)$|\1|p"
1.23.0
1.23.1
1.23.2
1.23.3
1.23.4
1.23.5
1.23.6
1.23.7
This commit is contained in:
limiting-factor 2025-05-09 12:22:45 +02:00
parent 5a339800d3
commit 5b5dab8c13
No known key found for this signature in database
GPG key ID: FBFC3FECD17D904F
3 changed files with 2 additions and 45 deletions

View file

@ -141,16 +141,13 @@ function download_forgejo() {
fi
}
: ${GITEA_AUTHORIZATION_HEADER:=}
function download_gitea() {
local version=$1
if ! test -f $DIR_BINARIES/gitea-$version; then
mkdir -p $DIR_BINARIES
if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then
full_version=$(curl -sS -H "$GITEA_AUTHORIZATION_HEADER" "https://code.forgejo.org/api/v1/repos/gitea/gitea/tags" | jq -r '.[] | .name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1)
full_version=${full_version#v}
full_version=$(git ls-remote --refs --tags --sort=version:refname https://git-mirror.forgejo.org/go-gitea/gitea "v$version*" | sed -n -E -e "s|^.*/v($version[\.0-9]*)$|\1|p" | tail -1)
else
full_version=$version
fi