ci: make Forgejo JDK install distro-aware
Some checks failed
Forgejo Release Builder / release (push) Failing after 1s
Some checks failed
Forgejo Release Builder / release (push) Failing after 1s
Detect dnf/apt/apk/pacman in the Forgejo release workflow so Java setup works across runner base images.
This commit is contained in:
parent
029c3a25f0
commit
1f554081a5
1 changed files with 13 additions and 2 deletions
|
|
@ -36,8 +36,19 @@ jobs:
|
|||
if command -v java >/dev/null 2>&1; then
|
||||
java -version
|
||||
else
|
||||
apt-get update
|
||||
apt-get install -y openjdk-17-jdk
|
||||
if command -v dnf >/dev/null 2>&1; then
|
||||
dnf install -y java-17-openjdk-devel
|
||||
elif command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get update
|
||||
apt-get install -y openjdk-17-jdk
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache openjdk17
|
||||
elif command -v pacman >/dev/null 2>&1; then
|
||||
pacman -Sy --noconfirm jdk17-openjdk
|
||||
else
|
||||
echo "No supported package manager found for JDK installation."
|
||||
exit 1
|
||||
fi
|
||||
java -version
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue