Merge commit 'd803bfe2b1fe7f5e219e50ac20d6801a0a58ac75' as 'vendor/ruvector'

This commit is contained in:
ruv
2026-02-28 14:39:40 -05:00
7854 changed files with 3522914 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Quick check and publish script for router-wasm
# Run this manually when router-core v0.1.1 is confirmed published
set -e
echo "Checking router-core v0.1.1 availability..."
if cargo search router-core 2>&1 | grep -q "router-core.*0\.1\.1"; then
echo "✓ router-core v0.1.1 is available!"
echo ""
echo "Proceeding with router-wasm publication..."
echo ""
# Load API key
export $(grep "^CRATES_API_KEY=" /workspaces/ruvector/.env | xargs)
# Login
cargo login "$CRATES_API_KEY"
# Publish
cd /workspaces/ruvector/crates/router-wasm
cargo publish --allow-dirty
echo ""
echo "✓ router-wasm v0.1.1 published successfully!"
else
echo "✗ router-core v0.1.1 not yet available on crates.io"
echo " Current version: $(cargo search router-core 2>&1 | grep 'router-core =' | head -1)"
echo ""
echo "Please wait for router-core v0.1.1 to be published first."
exit 1
fi

View File

@@ -0,0 +1,68 @@
#!/bin/bash
# RuVector - Publish All Packages Script
# Triggers GitHub Actions workflow to build and publish for all platforms
set -e
VERSION="${1:-0.1.31}"
DRY_RUN="${2:-false}"
echo "🚀 RuVector Publish All Packages"
echo "================================"
echo "Version: $VERSION"
echo "Dry Run: $DRY_RUN"
echo ""
# Check if gh CLI is available
if ! command -v gh &> /dev/null; then
echo "❌ GitHub CLI (gh) is required. Install with: brew install gh"
exit 1
fi
# Check if logged in
if ! gh auth status &> /dev/null; then
echo "❌ Not logged into GitHub. Run: gh auth login"
exit 1
fi
echo "📦 Packages to publish:"
echo " crates.io:"
echo " - ruvector-math v$VERSION"
echo " - ruvector-attention v$VERSION"
echo " - ruvector-math-wasm v$VERSION"
echo " - ruvector-attention-wasm v$VERSION"
echo ""
echo " npm:"
echo " - ruvector-math-wasm v$VERSION"
echo " - @ruvector/attention v$VERSION"
echo " - @ruvector/attention-wasm v$VERSION"
echo " - @ruvector/attention-linux-x64-gnu v$VERSION"
echo " - @ruvector/attention-linux-arm64-gnu v$VERSION"
echo " - @ruvector/attention-darwin-x64 v$VERSION"
echo " - @ruvector/attention-darwin-arm64 v$VERSION"
echo " - @ruvector/attention-win32-x64-msvc v$VERSION"
echo ""
read -p "Continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 0
fi
echo ""
echo "🔄 Triggering GitHub Actions workflow..."
gh workflow run publish-all.yml \
--field version="$VERSION" \
--field publish_crates=true \
--field publish_npm=true \
--field dry_run="$DRY_RUN"
echo ""
echo "✅ Workflow triggered!"
echo ""
echo "📊 Monitor progress at:"
echo " https://github.com/ruvnet/ruvector/actions/workflows/publish-all.yml"
echo ""
echo "Or run: gh run list --workflow=publish-all.yml"

View File

@@ -0,0 +1,3 @@
#!/bin/bash
# Publish ruvector-cli to crates.io
cargo publish -p ruvector-cli --allow-dirty

View File

@@ -0,0 +1,165 @@
#!/bin/bash
set -e
# Ruvector Crates Publishing Script
# This script publishes all Ruvector crates to crates.io in the correct dependency order
#
# Prerequisites:
# - Rust and Cargo installed
# - CRATES_API_KEY set in .env file
# - All crates build successfully
# - All tests pass
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Load environment variables from .env
if [ -f .env ]; then
export $(grep -v '^#' .env | grep CRATES_API_KEY | xargs)
else
echo -e "${RED}Error: .env file not found${NC}"
exit 1
fi
# Check if CRATES_API_KEY is set
if [ -z "$CRATES_API_KEY" ]; then
echo -e "${RED}Error: CRATES_API_KEY not found in .env${NC}"
exit 1
fi
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE} Ruvector Crates Publishing Script${NC}"
echo -e "${BLUE}========================================${NC}"
echo ""
# Configure cargo authentication
echo -e "${YELLOW}Configuring cargo authentication...${NC}"
cargo login "$CRATES_API_KEY"
echo -e "${GREEN}✓ Authentication configured${NC}"
echo ""
# Function to publish a crate
publish_crate() {
local crate_path=$1
local crate_name=$(basename "$crate_path")
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}Publishing: ${crate_name}${NC}"
echo -e "${BLUE}========================================${NC}"
cd "$crate_path"
# Verify the package
echo -e "${YELLOW}Verifying package...${NC}"
if cargo package --allow-dirty; then
echo -e "${GREEN}✓ Package verification successful${NC}"
else
echo -e "${RED}✗ Package verification failed${NC}"
cd - > /dev/null
return 1
fi
# Publish the package
echo -e "${YELLOW}Publishing to crates.io...${NC}"
if cargo publish --allow-dirty; then
echo -e "${GREEN}${crate_name} published successfully${NC}"
else
echo -e "${RED}✗ Failed to publish ${crate_name}${NC}"
cd - > /dev/null
return 1
fi
cd - > /dev/null
# Wait a bit for crates.io to index the crate
echo -e "${YELLOW}Waiting 30 seconds for crates.io to index...${NC}"
sleep 30
echo ""
}
# Function to check if crate is already published
check_published() {
local crate_name=$1
local version=$2
if cargo search "$crate_name" --limit 1 | grep -q "^$crate_name = \"$version\""; then
return 0 # Already published
else
return 1 # Not published
fi
}
# Get version from workspace
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
echo -e "${BLUE}Publishing version: ${VERSION}${NC}"
echo ""
# Publishing order (dependencies first)
CRATES=(
# Base dependencies (no internal dependencies)
"crates/ruvector-core"
"crates/router-core"
# Depends on ruvector-core
"crates/ruvector-node"
"crates/ruvector-wasm"
"crates/ruvector-cli"
"crates/ruvector-bench"
# Depends on router-core
"crates/router-cli"
"crates/router-ffi"
"crates/router-wasm"
)
# Track success/failure
SUCCESS_COUNT=0
FAILED_CRATES=()
# Publish each crate
for crate in "${CRATES[@]}"; do
if [ ! -d "$crate" ]; then
echo -e "${YELLOW}Warning: $crate directory not found, skipping${NC}"
continue
fi
crate_name=$(basename "$crate")
# Check if already published
if check_published "$crate_name" "$VERSION"; then
echo -e "${YELLOW}$crate_name v$VERSION already published, skipping${NC}"
((SUCCESS_COUNT++))
echo ""
continue
fi
if publish_crate "$crate"; then
((SUCCESS_COUNT++))
else
FAILED_CRATES+=("$crate_name")
fi
done
# Summary
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE} Publishing Summary${NC}"
echo -e "${BLUE}========================================${NC}"
echo -e "${GREEN}Successfully published: ${SUCCESS_COUNT}/${#CRATES[@]}${NC}"
if [ ${#FAILED_CRATES[@]} -gt 0 ]; then
echo -e "${RED}Failed to publish:${NC}"
for crate in "${FAILED_CRATES[@]}"; do
echo -e "${RED} - $crate${NC}"
done
exit 1
else
echo -e "${GREEN}All crates published successfully! 🎉${NC}"
fi
echo ""
echo -e "${BLUE}View your crates at: https://crates.io/users/ruvector${NC}"

View File

@@ -0,0 +1,80 @@
#!/bin/bash
# Script to publish router-wasm v0.1.1 to crates.io
# This script waits for router-core v0.1.1 to be available
set -e
echo "=========================================="
echo "router-wasm v0.1.1 Publication Script"
echo "=========================================="
echo ""
# Load environment variables
if [ -f /workspaces/ruvector/.env ]; then
echo "✓ Loading CRATES_API_KEY from .env..."
export $(grep "^CRATES_API_KEY=" /workspaces/ruvector/.env | xargs)
else
echo "✗ Error: .env file not found"
exit 1
fi
if [ -z "$CRATES_API_KEY" ]; then
echo "✗ Error: CRATES_API_KEY not found in .env"
exit 1
fi
echo "✓ CRATES_API_KEY loaded"
echo ""
# Step 1: Wait for router-core v0.1.1
echo "Step 1: Checking for router-core v0.1.1..."
MAX_ATTEMPTS=30
ATTEMPT=0
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
ATTEMPT=$((ATTEMPT + 1))
echo " Check $ATTEMPT/$MAX_ATTEMPTS ($(date +%H:%M:%S))"
if cargo search router-core 2>&1 | grep -q "router-core.*0\.1\.1"; then
echo "✓ router-core v0.1.1 found on crates.io!"
break
fi
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
echo "✗ Timeout: router-core v0.1.1 not found after $MAX_ATTEMPTS attempts"
echo " Current version: $(cargo search router-core 2>&1 | grep "router-core =" | head -1)"
exit 1
fi
sleep 10
done
echo ""
# Step 2: Login to crates.io
echo "Step 2: Logging in to crates.io..."
cargo login "$CRATES_API_KEY"
echo "✓ Successfully logged in"
echo ""
# Step 3: Navigate to router-wasm directory
echo "Step 3: Navigating to router-wasm directory..."
cd /workspaces/ruvector/crates/router-wasm
echo "✓ Current directory: $(pwd)"
echo ""
# Step 4: Verify package
echo "Step 4: Verifying package..."
cargo package --list --allow-dirty | head -20
echo "..."
echo ""
# Step 5: Publish
echo "Step 5: Publishing router-wasm v0.1.1..."
echo ""
cargo publish --allow-dirty
echo ""
echo "=========================================="
echo "✓ SUCCESS: router-wasm v0.1.1 published!"
echo "=========================================="