even more fucking checks

This commit is contained in:
John Doe
2026-01-31 11:19:03 -05:00
parent d4e87a8110
commit f8a54b956a

View File

@@ -40,10 +40,34 @@ jobs:
if: failure()
run: |
echo "Setting up Node.js manually as fallback..."
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version
npm --version
# Try different installation methods
if command -v apt-get >/dev/null 2>&1; then
echo "Using apt-get..."
apt-get update
apt-get install -y nodejs npm
elif command -v apk >/dev/null 2>&1; then
echo "Using apk (Alpine)..."
apk add --no-cache nodejs npm
elif command -v yum >/dev/null 2>&1; then
echo "Using yum..."
yum install -y nodejs npm
else
echo "No compatible package manager found"
# Try to download and install directly
if command -v wget >/dev/null 2>&1; then
echo "Downloading Node.js with wget..."
cd /tmp
wget https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz
tar -xf node-v20.11.0-linux-x64.tar.xz
export PATH="/tmp/node-v20.11.0-linux-x64/bin:$PATH"
echo "/tmp/node-v20.11.0-linux-x64/bin" >> $GITHUB_PATH
else
echo "Cannot install Node.js - no installation method available"
exit 1
fi
fi
node --version || echo "Node installation failed"
npm --version || echo "NPM installation failed"
# Verify Node.js installation
- name: Verify Node.js installation
@@ -56,7 +80,26 @@ jobs:
- name: Determine final version
id: get_final_ver
run: |
BASE_VER=v$(jq -r '.version' package.json)
# Ensure Node.js tools are available
if ! command -v node >/dev/null 2>&1; then
echo "Node.js not found, trying alternative version detection..."
if [ -f package.json ]; then
# Try to parse version without jq
BASE_VER="v$(grep '"version"' package.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')"
else
BASE_VER="v0.0.0"
echo "Warning: No package.json found, using default version"
fi
else
# Use jq if available (requires Node.js ecosystem)
if command -v jq >/dev/null 2>&1; then
BASE_VER=v$(jq -r '.version' package.json)
else
# Fallback parsing without jq
BASE_VER="v$(grep '"version"' package.json | sed 's/.*"version": *"\([^"]*\)".*/\1/')"
fi
fi
TODAY=$(date +'%Y.%m.%d')
echo "Today will be: $TODAY"