From 5d2ad902fbcd5b8774300278f55165f649dcbe5e Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 29 Oct 2025 17:02:57 +0100 Subject: [PATCH] install node all --- .gitea/workflows/demo.yaml | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index e835313..46464fd 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -21,11 +21,38 @@ jobs: - name: Install Node.js, npm, and Yarn run: | - apt update - apt install -y curl - curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - - apt install -y nodejs - npm install -g yarn + set -e + echo "Detecting OS and installing Node.js, npm, and Yarn..." + + if command -v apt >/dev/null 2>&1; then + echo "Using apt package manager (Debian/Ubuntu)..." + apt update -y + apt install -y curl ca-certificates + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs + npm install -g yarn + + elif command -v apk >/dev/null 2>&1; then + echo "Using apk package manager (Alpine)..." + apk update + apk add --no-cache curl nodejs npm + npm install -g yarn + + elif command -v dnf >/dev/null 2>&1; then + echo "Using dnf package manager (Fedora/RHEL)..." + dnf install -y curl ca-certificates nodejs npm + npm install -g yarn + + else + echo "No supported package manager found (apt, apk, dnf)." + exit 1 + fi + + echo "Node.js, npm, and Yarn installed successfully." + node -v + npm -v + yarn -v + - name: Checkout repository manually env: @@ -40,9 +67,6 @@ jobs: - name: List repo files and dependencies versions run: | ls . - node -v - npm -v - yarn -v - name: Done run: echo "Workflow finished."