CI: ensure curl is available in Forgejo release steps
Some checks failed
Forgejo Release Builder / release (push) Failing after 16m51s
Some checks failed
Forgejo Release Builder / release (push) Failing after 16m51s
This commit is contained in:
parent
52036476a2
commit
0d6a348578
1 changed files with 52 additions and 0 deletions
|
|
@ -315,7 +315,33 @@ jobs:
|
||||||
fi
|
fi
|
||||||
discover_jq
|
discover_jq
|
||||||
}
|
}
|
||||||
|
ensure_curl() {
|
||||||
|
if command -v curl >/dev/null 2>&1; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
run_as_root() {
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
"$@"
|
||||||
|
elif command -v sudo >/dev/null 2>&1; then
|
||||||
|
sudo "$@"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if command -v dnf >/dev/null 2>&1; then
|
||||||
|
run_as_root dnf install -y curl
|
||||||
|
elif command -v apt-get >/dev/null 2>&1; then
|
||||||
|
run_as_root apt-get update
|
||||||
|
run_as_root apt-get install -y curl
|
||||||
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
|
run_as_root apk add --no-cache curl
|
||||||
|
elif command -v pacman >/dev/null 2>&1; then
|
||||||
|
run_as_root pacman -Sy --noconfirm curl
|
||||||
|
fi
|
||||||
|
command -v curl >/dev/null 2>&1
|
||||||
|
}
|
||||||
ensure_jq || { echo "jq not found; install jq on the runner (dnf install -y jq)."; exit 1; }
|
ensure_jq || { echo "jq not found; install jq on the runner (dnf install -y jq)."; exit 1; }
|
||||||
|
ensure_curl || { echo "curl not found; install curl on the runner (dnf install -y curl)."; exit 1; }
|
||||||
|
|
||||||
api_base="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases"
|
api_base="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases"
|
||||||
payload_file="$(mktemp)"
|
payload_file="$(mktemp)"
|
||||||
|
|
@ -437,7 +463,33 @@ jobs:
|
||||||
fi
|
fi
|
||||||
discover_jq
|
discover_jq
|
||||||
}
|
}
|
||||||
|
ensure_curl() {
|
||||||
|
if command -v curl >/dev/null 2>&1; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
run_as_root() {
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
"$@"
|
||||||
|
elif command -v sudo >/dev/null 2>&1; then
|
||||||
|
sudo "$@"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if command -v dnf >/dev/null 2>&1; then
|
||||||
|
run_as_root dnf install -y curl
|
||||||
|
elif command -v apt-get >/dev/null 2>&1; then
|
||||||
|
run_as_root apt-get update
|
||||||
|
run_as_root apt-get install -y curl
|
||||||
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
|
run_as_root apk add --no-cache curl
|
||||||
|
elif command -v pacman >/dev/null 2>&1; then
|
||||||
|
run_as_root pacman -Sy --noconfirm curl
|
||||||
|
fi
|
||||||
|
command -v curl >/dev/null 2>&1
|
||||||
|
}
|
||||||
ensure_jq || { echo "jq not found; install jq on the runner (dnf install -y jq)."; exit 1; }
|
ensure_jq || { echo "jq not found; install jq on the runner (dnf install -y jq)."; exit 1; }
|
||||||
|
ensure_curl || { echo "curl not found; install curl on the runner (dnf install -y curl)."; exit 1; }
|
||||||
|
|
||||||
release_api="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}"
|
release_api="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}"
|
||||||
assets_file="$(mktemp)"
|
assets_file="$(mktemp)"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue