Fix build_all.sh: replace 'env' command with direct export
- The 'env GOOS=x GOARCH=y command' syntax fails on some systems - Using 'export GOOS GOARCH' before go build for better compatibility - Updated version to 3.1.0 - All 10 platform builds now succeed
This commit is contained in:
@@ -15,7 +15,7 @@ echo "🔧 Using Go version: $GO_VERSION"
|
|||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
APP_NAME="dbbackup"
|
APP_NAME="dbbackup"
|
||||||
VERSION="3.0.0"
|
VERSION="3.1.0"
|
||||||
BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S_UTC')
|
BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S_UTC')
|
||||||
GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
||||||
BIN_DIR="bin"
|
BIN_DIR="bin"
|
||||||
@@ -82,8 +82,9 @@ for platform_config in "${PLATFORMS[@]}"; do
|
|||||||
|
|
||||||
echo -e "${YELLOW}[$current/$total_platforms]${NC} Building for ${BOLD}$description${NC} (${platform})"
|
echo -e "${YELLOW}[$current/$total_platforms]${NC} Building for ${BOLD}$description${NC} (${platform})"
|
||||||
|
|
||||||
# Set environment and build
|
# Set environment and build (using export for better compatibility)
|
||||||
if env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "$LDFLAGS" -o "${BIN_DIR}/${binary_name}" . 2>/dev/null; then
|
export GOOS GOARCH
|
||||||
|
if go build -ldflags "$LDFLAGS" -o "${BIN_DIR}/${binary_name}" . 2>/dev/null; then
|
||||||
# Get file size
|
# Get file size
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
size=$(stat -f%z "${BIN_DIR}/${binary_name}" 2>/dev/null || echo "0")
|
size=$(stat -f%z "${BIN_DIR}/${binary_name}" 2>/dev/null || echo "0")
|
||||||
|
|||||||
Reference in New Issue
Block a user