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:
parent
5a339800d3
commit
5b5dab8c13
3 changed files with 2 additions and 45 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue