build fixes

This commit is contained in:
2025-12-02 19:25:19 +01:00
parent bc197d4080
commit 52d1df4c2f
4 changed files with 41 additions and 16 deletions

View File

@@ -13,6 +13,11 @@ GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Extract version from Cargo.toml
VERSION=$(grep -m1 '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "Version: $VERSION"
echo ""
# Create dist directory
DIST_DIR="dist"
mkdir -p "$DIST_DIR"
@@ -27,15 +32,15 @@ build_target() {
if cargo build --release --target "$target"; then
echo -e "${GREEN}✓ Build successful for $name${NC}"
# Copy binary to dist directory
# Copy binary to dist directory with version
if [[ "$target" == *"windows"* ]]; then
cp "target/$target/release/rlogg.exe" "$DIST_DIR/rlogg-$name.exe"
echo -e "${GREEN}✓ Binary copied to $DIST_DIR/rlogg-$name.exe${NC}"
cp "target/$target/release/rlogg.exe" "$DIST_DIR/rlogg-$VERSION-$name.exe"
echo -e "${GREEN}✓ Binary copied to $DIST_DIR/rlogg-$VERSION-$name.exe${NC}"
else
cp "target/$target/release/rlogg" "$DIST_DIR/rlogg-$name"
cp "target/$target/release/rlogg" "$DIST_DIR/rlogg-$VERSION-$name"
# Strip binary on Unix-like systems
strip "$DIST_DIR/rlogg-$name" 2>/dev/null || true
echo -e "${GREEN}✓ Binary copied to $DIST_DIR/rlogg-$name${NC}"
strip "$DIST_DIR/rlogg-$VERSION-$name" 2>/dev/null || true
echo -e "${GREEN}✓ Binary copied to $DIST_DIR/rlogg-$VERSION-$name${NC}"
fi
echo ""
return 0