Implement multi-platform build system with pure Go support
- Introduced a comprehensive build system that supports multiple platforms (Linux, macOS, Windows, Android) using pure Go builds (`CGO_ENABLED=0`). - Updated all build and test scripts to ensure compatibility with the new purego approach, allowing for dynamic loading of `libsecp256k1` at runtime. - Added detailed documentation on the build process, platform detection, and deployment options. - Enhanced CI/CD workflows to automate builds for all supported platforms and include necessary libraries in releases. - Updated `.gitignore` to exclude build output files. - Created new documentation files for deployment and multi-platform build summaries.
This commit is contained in:
65
scripts/run-orly.sh
Executable file
65
scripts/run-orly.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Universal run script for ORLY relay
|
||||
# Automatically selects the correct binary for the current platform
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
# Source platform detection
|
||||
source "$SCRIPT_DIR/platform-detect.sh"
|
||||
|
||||
# Get version
|
||||
VERSION=$(cat "$REPO_ROOT/pkg/version/version")
|
||||
|
||||
# Detect platform
|
||||
PLATFORM=$(detect_platform)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: Could not detect platform"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Detected platform: $PLATFORM"
|
||||
|
||||
# Get binary name
|
||||
BINARY_NAME=$(get_binary_name "$VERSION")
|
||||
BINARY_PATH="$REPO_ROOT/build/$BINARY_NAME"
|
||||
|
||||
# Check if binary exists
|
||||
if [ ! -f "$BINARY_PATH" ]; then
|
||||
echo "Error: Binary not found: $BINARY_PATH"
|
||||
echo ""
|
||||
echo "Please run: ./scripts/build-all-platforms.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get library name and set library path
|
||||
LIBRARY_NAME=$(get_library_name)
|
||||
LIBRARY_PATH="$REPO_ROOT/build/$LIBRARY_NAME"
|
||||
|
||||
if [ -f "$LIBRARY_PATH" ]; then
|
||||
case "$PLATFORM" in
|
||||
linux-*)
|
||||
export LD_LIBRARY_PATH="$REPO_ROOT/build:${LD_LIBRARY_PATH:-}"
|
||||
;;
|
||||
darwin-*)
|
||||
export DYLD_LIBRARY_PATH="$REPO_ROOT/build:${DYLD_LIBRARY_PATH:-}"
|
||||
;;
|
||||
windows-*)
|
||||
export PATH="$REPO_ROOT/build:${PATH:-}"
|
||||
;;
|
||||
esac
|
||||
echo "Library path set for: $LIBRARY_NAME"
|
||||
else
|
||||
echo "Warning: Library not found: $LIBRARY_PATH"
|
||||
echo "Binary may not work if it requires libsecp256k1"
|
||||
fi
|
||||
|
||||
echo "Running: $BINARY_NAME"
|
||||
echo ""
|
||||
|
||||
# Execute the binary with all arguments passed to this script
|
||||
exec "$BINARY_PATH" "$@"
|
||||
|
||||
Reference in New Issue
Block a user