apk vs apt
Some checks failed
checks / Set up Node and other necessary dependencies for Frontend Tests and Build (push) Failing after 0s
checks / Set up Java for Backend Tests and Build (push) Failing after 4s
Gitea Actions Demo / Explore-Gitea-Actions (pull_request) Failing after 0s
Gitea Actions Demo / Explore-Gitea-Actions-2 (pull_request) Failing after 0s
checks / Set up Node and other necessary dependencies for Frontend Tests and Build (pull_request) Failing after 0s
checks / Set up Java for Backend Tests and Build (pull_request) Failing after 4s
Some checks failed
checks / Set up Node and other necessary dependencies for Frontend Tests and Build (push) Failing after 0s
checks / Set up Java for Backend Tests and Build (push) Failing after 4s
Gitea Actions Demo / Explore-Gitea-Actions (pull_request) Failing after 0s
Gitea Actions Demo / Explore-Gitea-Actions-2 (pull_request) Failing after 0s
checks / Set up Node and other necessary dependencies for Frontend Tests and Build (pull_request) Failing after 0s
checks / Set up Java for Backend Tests and Build (pull_request) Failing after 4s
This commit is contained in:
@ -103,36 +103,36 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Check if apt-get exists; if not, install it
|
# Detect package manager
|
||||||
if ! command -v apt-get &> /dev/null; then
|
if command -v apt-get &> /dev/null; then
|
||||||
echo "apt-get not found. Attempting to install..."
|
echo "Debian/Ubuntu detected, using apt-get..."
|
||||||
if command -v apk &> /dev/null; then
|
apt-get update -qq
|
||||||
echo "Using apk to install apt (Alpine detected)..."
|
apt-get install -y -qq wget curl ca-certificates gnupg software-properties-common
|
||||||
apk update
|
wget -q https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb
|
||||||
apk add --no-cache apt
|
apt install -y -qq ./jdk-21_linux-x64_bin.deb
|
||||||
elif command -v dnf &> /dev/null; then
|
|
||||||
echo "Using dnf (Fedora/RHEL detected)..."
|
elif command -v apk &> /dev/null; then
|
||||||
dnf install -y apt
|
echo "Alpine detected, using apk..."
|
||||||
|
apk update >/dev/null
|
||||||
|
apk add --no-cache openjdk21 wget curl ca-certificates >/dev/null
|
||||||
|
|
||||||
elif command -v yum &> /dev/null; then
|
elif command -v yum &> /dev/null; then
|
||||||
echo "Using yum (CentOS/RHEL detected)..."
|
echo "RHEL/CentOS detected, using yum..."
|
||||||
yum install -y apt
|
yum install -y -q wget curl ca-certificates gnupg2 >/dev/null
|
||||||
|
|
||||||
|
elif command -v dnf &> /dev/null; then
|
||||||
|
echo "Fedora detected, using dnf..."
|
||||||
|
dnf install -y -q wget curl ca-certificates gnupg2 >/dev/null
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "No supported package manager found!"
|
echo "No supported package manager found!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Continue installation using apt-get
|
|
||||||
apt-get update -y
|
|
||||||
apt-get install -y apt-transport-https ca-certificates curl gnupg wget software-properties-common
|
|
||||||
|
|
||||||
# Download and install Oracle JDK 21
|
|
||||||
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb
|
|
||||||
apt install -y ./jdk-21_linux-x64_bin.deb
|
|
||||||
|
|
||||||
# Verify installation
|
# Verify installation
|
||||||
java -version
|
java -version
|
||||||
|
|
||||||
|
|
||||||
- name: Set up Java 21 and Maven
|
- name: Set up Java 21 and Maven
|
||||||
run: |
|
run: |
|
||||||
if command -v act >/dev/null 2>&1; then
|
if command -v act >/dev/null 2>&1; then
|
||||||
|
|||||||
Reference in New Issue
Block a user