Add gitea donwload file version info, missing installs are no longer forced exit

fix restart of act runner after update

when downloading gitea or act runner it will show the version that is downlaoded.
if the same version is downloaded again and alrady exists, download will be skipped
This commit is contained in:
Clemens Schwaighofer
2025-02-27 12:38:18 +09:00
parent 11c1daf4a1
commit 324b577134
4 changed files with 33 additions and 9 deletions

View File

@@ -4,11 +4,21 @@ BASE_FOLDER=$(dirname "$(readlink -f "$0")")"/";
# shellcheck source=init.sh
. "${BASE_FOLDER}init.sh";
cd "${download_folder}" || exit;
curl -s https://api.github.com/repos/go-gitea/gitea/releases/latest |\
download_file=$(curl -s https://api.github.com/repos/go-gitea/gitea/releases/latest |\
grep browser_download_url |\
cut -d '"' -f 4 |\
grep "${arch}$" |\
grep "${arch}$");
version=$(echo "${download_file}" | cut -d "/" -f 8);
file=$(echo "${download_file}" | cut -d "/" -f 9);
if [ -f "${download_folder}/${file}" ]; then
echo "[!] File ${file} has already been downloaded";
exit;
fi;
echo "gitea version to download: ${version}";
cd "${download_folder}" || exit;
echo "${download_file}" |\
xargs curl -LJO --output-dir "${download_folder}"
cd - || exit;