diff --git a/.forgejo/workflows/compile-apt-layer.yml b/.forgejo/workflows/compile-apt-layer.yml index c152b02..746f8b2 100644 --- a/.forgejo/workflows/compile-apt-layer.yml +++ b/.forgejo/workflows/compile-apt-layer.yml @@ -28,8 +28,38 @@ jobs: - name: Set up environment run: | 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 run: |