feat: complete migration to Deno with automated releases
- Remove old Node.js infrastructure (package.json, tsconfig.json, bin/nupst launcher, setup.sh) - Update install.sh to download pre-compiled binaries from Gitea releases - Add Gitea Actions CI/CD workflows: - ci.yml: Type checking, linting, and build verification - release.yml: Automated binary compilation and release on tags - Update .gitignore for Deno-focused project structure - Binary-based distribution requires no dependencies or build steps
This commit is contained in:
96
bin/nupst
96
bin/nupst
@@ -1,96 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NUPST Launcher Script
|
||||
# This script detects architecture and OS, then runs NUPST with the appropriate Node.js binary
|
||||
|
||||
# First, handle symlinks correctly
|
||||
REAL_SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
|
||||
SCRIPT_DIR=$(dirname "$REAL_SCRIPT_PATH")
|
||||
|
||||
# For debugging
|
||||
# echo "Script path: $REAL_SCRIPT_PATH"
|
||||
# echo "Script dir: $SCRIPT_DIR"
|
||||
|
||||
# If we're run via symlink from /usr/local/bin, use the hardcoded installation path
|
||||
if [[ "$SCRIPT_DIR" == "/usr/local/bin" ]]; then
|
||||
PROJECT_ROOT="/opt/nupst"
|
||||
else
|
||||
# Otherwise, use relative path from script location
|
||||
PROJECT_ROOT="$( cd "$SCRIPT_DIR/.." &> /dev/null && pwd )"
|
||||
fi
|
||||
|
||||
# For debugging
|
||||
# echo "Project root: $PROJECT_ROOT"
|
||||
|
||||
# Detect architecture and OS
|
||||
ARCH=$(uname -m)
|
||||
OS=$(uname -s)
|
||||
|
||||
# Determine Node.js binary location based on architecture and OS
|
||||
NODE_BIN=""
|
||||
case "$OS" in
|
||||
Linux)
|
||||
case "$ARCH" in
|
||||
x86_64)
|
||||
NODE_BIN="$PROJECT_ROOT/vendor/node-linux-x64/bin/node"
|
||||
;;
|
||||
aarch64|arm64)
|
||||
NODE_BIN="$PROJECT_ROOT/vendor/node-linux-arm64/bin/node"
|
||||
;;
|
||||
*)
|
||||
# Use system Node as fallback for other architectures
|
||||
if command -v node &> /dev/null; then
|
||||
NODE_BIN="node"
|
||||
echo "Using system Node.js installation for unsupported architecture: $ARCH"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
Darwin)
|
||||
case "$ARCH" in
|
||||
x86_64)
|
||||
NODE_BIN="$PROJECT_ROOT/vendor/node-darwin-x64/bin/node"
|
||||
;;
|
||||
arm64)
|
||||
NODE_BIN="$PROJECT_ROOT/vendor/node-darwin-arm64/bin/node"
|
||||
;;
|
||||
*)
|
||||
# Use system Node as fallback for other architectures
|
||||
if command -v node &> /dev/null; then
|
||||
NODE_BIN="node"
|
||||
echo "Using system Node.js installation for unsupported architecture: $ARCH"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Use system Node as fallback for other operating systems
|
||||
if command -v node &> /dev/null; then
|
||||
NODE_BIN="node"
|
||||
echo "Using system Node.js installation for unsupported OS: $OS"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If binary doesn't exist, try system Node as fallback
|
||||
if [ -z "$NODE_BIN" ] || [ ! -f "$NODE_BIN" ]; then
|
||||
if command -v node &> /dev/null; then
|
||||
NODE_BIN="node"
|
||||
echo "Using system Node.js installation"
|
||||
else
|
||||
echo "Error: Node.js binary not found for $OS-$ARCH"
|
||||
echo "Please run the setup script or install Node.js manually."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Run NUPST with the Node.js binary
|
||||
if [ -f "$PROJECT_ROOT/dist_ts/index.js" ]; then
|
||||
exec "$NODE_BIN" "$PROJECT_ROOT/dist_ts/index.js" "$@"
|
||||
elif [ -f "$PROJECT_ROOT/dist/index.js" ]; then
|
||||
exec "$NODE_BIN" "$PROJECT_ROOT/dist/index.js" "$@"
|
||||
else
|
||||
echo "Error: Could not find NUPST's index.js file."
|
||||
echo "Please run the setup script to download the required files."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user