Fix Forgejo workflow: add multi-distro package manager support
Some checks failed
Compile apt-layer / compile (push) Failing after 3s
Some checks failed
Compile apt-layer / compile (push) Failing after 3s
This commit is contained in:
parent
687210be82
commit
c85d9af526
1 changed files with 32 additions and 2 deletions
|
|
@ -28,8 +28,38 @@ jobs:
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
run: |
|
run: |
|
||||||
echo "Setting up compilation environment..."
|
echo "Setting up compilation environment..."
|
||||||
apt-get update
|
|
||||||
apt-get install -y jq dos2unix bash
|
# Try different package managers
|
||||||
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
|
echo "Using apt-get package manager..."
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y jq dos2unix bash
|
||||||
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
|
echo "Using apk package manager..."
|
||||||
|
apk update
|
||||||
|
apk add jq dos2unix bash
|
||||||
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
|
echo "Using yum package manager..."
|
||||||
|
yum install -y jq dos2unix bash
|
||||||
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
|
echo "Using dnf package manager..."
|
||||||
|
dnf install -y jq dos2unix bash
|
||||||
|
else
|
||||||
|
echo "No supported package manager found. Checking if tools are already available..."
|
||||||
|
# Check if tools are already available
|
||||||
|
if ! command -v jq >/dev/null 2>&1; then
|
||||||
|
echo "❌ jq not found and no package manager available"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! command -v dos2unix >/dev/null 2>&1; then
|
||||||
|
echo "⚠️ dos2unix not found, but continuing..."
|
||||||
|
fi
|
||||||
|
if ! command -v bash >/dev/null 2>&1; then
|
||||||
|
echo "❌ bash not found and no package manager available"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✅ Required tools are already available"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Make compile scripts executable
|
- name: Make compile scripts executable
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue