diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 9ef5f77..c2314bb 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -15,9 +15,9 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] include: - - os: ubuntu-20.04 + - os: ubuntu-latest artifact_name: voxvera-linux asset_name: voxvera-linux - os: windows-latest @@ -63,6 +63,8 @@ jobs: - name: Build .deb (Linux) if: matrix.os == 'ubuntu-latest' run: | + mkdir -p voxvera/resources/bin + cp dist/${{ matrix.artifact_name }} voxvera/resources/bin/voxvera-linux-x86_64 chmod +x packaging/build_deb.sh ./packaging/build_deb.sh dist/${{ matrix.artifact_name }} @@ -72,19 +74,23 @@ jobs: mkdir -p voxvera/resources/bin cp dist/${{ matrix.artifact_name }} voxvera/resources/bin/voxvera-linux-x86_64 chmod +x packaging/build_appimage.sh - ./packaging/build_appimage.sh + ./packaging/build_appimage.sh dist/${{ matrix.artifact_name }} - name: Build Flatpak (Linux) if: matrix.os == 'ubuntu-latest' run: | + mkdir -p voxvera/resources/bin + cp dist/${{ matrix.artifact_name }} voxvera/resources/bin/voxvera-linux-x86_64 sudo apt-get update sudo apt-get install -y flatpak flatpak-builder chmod +x packaging/build_flatpak.sh - ./packaging/build_flatpak.sh || echo "Flatpak build failed" + ./packaging/build_flatpak.sh dist/${{ matrix.artifact_name }} || echo "Flatpak build failed" - name: Build .dmg (macOS) if: matrix.os == 'macos-latest' run: | + mkdir -p voxvera/resources/bin + cp dist/${{ matrix.artifact_name }} voxvera/resources/bin/voxvera-macos-x86_64 chmod +x packaging/build_dmg.sh ./packaging/build_dmg.sh dist/${{ matrix.artifact_name }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c0f737..fc3f6d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - pip install -e . + pip install flake8 + pip install -e ".[test]" - name: Lint run: flake8 voxvera tests --exclude=voxvera/vendor --ignore=E501,W503,W293,E402,E306,E704,E261,F841,E302,F401,E401,F541 - name: Test diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index cade543..52976ee 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -20,7 +20,8 @@ jobs: run: | sudo apt-get update sudo apt-get install -y tor - pip install ".[e2e]" + python -m pip install --upgrade pip + pip install -e ".[e2e]" - name: Run end-to-end tests run: ci/test-e2e.sh - name: Upload logs diff --git a/install.sh b/install.sh index 8a5f1fa..fdc926a 100755 --- a/install.sh +++ b/install.sh @@ -115,47 +115,67 @@ download_binary() { } # Install VoxVera (Always use --force to ensure fresh installation) +if command_exists curl; then + msg "Attempting to download latest VoxVera binary..." + # Get the latest release tag + latest=$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/PR0M3TH3AN/VoxVera/releases/latest | grep -oE '[^/]+$') + + install_dir="$HOME/.local/bin" + mkdir -p "$install_dir" + dest="$install_dir/voxvera" + OS="$(uname -s | tr '[:upper:]' '[:lower:]')" + case "$OS" in + linux*) BINARY="voxvera-linux" ;; + darwin*) BINARY="voxvera-macos" ;; + *) BINARY="voxvera-linux" ;; + esac + + # Try to download architecture-specific binary first (x86_64) + ARCH=$(uname -m) + if [ "$ARCH" == "x86_64" ]; then + url="https://github.com/PR0M3TH3AN/VoxVera/releases/download/${latest}/${BINARY}-x86_64" + if curl -fsSL "$url" -o "$dest"; then + chmod +x "$dest" + msg "VoxVera binary (${ARCH}) installed to $dest" + [[ ":$PATH:" != *":$HOME/.local/bin:"* ]] && warn "Add \$HOME/.local/bin to your PATH." + exit 0 + fi + fi + + # Fallback to generic binary + url="https://github.com/PR0M3TH3AN/VoxVera/releases/download/${latest}/${BINARY}" + if curl -fsSL "$url" -o "$dest"; then + chmod +x "$dest" + msg "VoxVera binary installed to $dest" + [[ ":$PATH:" != *":$HOME/.local/bin:"* ]] && warn "Add \$HOME/.local/bin to your PATH." + exit 0 + fi +fi + if command_exists pipx; then - msg "Installing/Re-installing VoxVera via pipx..." + msg "Falling back to pipx installation (this may take a few minutes)..." if pipx install --force 'voxvera@git+https://github.com/PR0M3TH3AN/VoxVera.git@main'; then pipx ensurepath --force msg "\nVoxVera installed/updated successfully via pipx." msg "IMPORTANT: Please restart your terminal or run 'source ~/.bashrc' (or your shell config) to use 'voxvera'." exit 0 fi - warn "pipx install failed, trying binary fallback..." + warn "pipx install failed, trying pip fallback..." fi -install_dir="$HOME/.local/bin" -mkdir -p "$install_dir" -OS="$(uname -s | tr '[:upper:]' '[:lower:]')" -case "$OS" in - linux*) BINARY="voxvera-linux" ;; - darwin*) BINARY="voxvera-macos" ;; - *) BINARY="voxvera-linux" ;; -esac - -url="https://github.com/PR0M3TH3AN/VoxVera/releases/latest/download/${BINARY}" -dest="$install_dir/voxvera" -msg "Downloading VoxVera binary from $url..." -if download_binary "$url" "$dest"; then - msg "VoxVera binary downloaded to $dest" - [[ ":$PATH:" != *":$HOME/.local/bin:"* ]] && warn "Add \$HOME/.local/bin to your PATH." +# Fallback to pip +msg "Installing/Updating VoxVera via pip..." +PIP_OPTS="--user --upgrade" +if [ -f /etc/debian_version ]; then + DEB_VER=$(cat /etc/debian_version | cut -d. -f1) + if [[ "$DEB_VER" =~ ^[0-9]+$ ]] && [ "$DEB_VER" -ge 12 ]; then + PIP_OPTS="$PIP_OPTS --break-system-packages" + fi +fi +if pip install $PIP_OPTS 'voxvera@git+https://github.com/PR0M3TH3AN/VoxVera.git@main'; then + msg "VoxVera installed via pip." else - warn "Binary download failed. Attempting pip install as last resort..." - # Use --break-system-packages on Debian 12+ if necessary - PIP_OPTS="--user --upgrade" - if [ -f /etc/debian_version ]; then - DEB_VER=$(cat /etc/debian_version | cut -d. -f1) - if [[ "$DEB_VER" =~ ^[0-9]+$ ]] && [ "$DEB_VER" -ge 12 ]; then - PIP_OPTS="$PIP_OPTS --break-system-packages" - fi - fi - if pip install $PIP_OPTS 'voxvera@git+https://github.com/PR0M3TH3AN/VoxVera.git@main'; then - msg "VoxVera installed via pip." - else - die "Installation failed." - fi + die "Installation failed." fi msg "\nVoxVera installed/updated successfully. Run 'voxvera check' to verify." diff --git a/voxvera-install.sh b/voxvera-install.sh index 353155d..a23fc59 100644 --- a/voxvera-install.sh +++ b/voxvera-install.sh @@ -64,31 +64,54 @@ elif ! command_exists onionshare-cli && ! command_exists onionshare; then fi fi -## -------- install VoxVera (prefers pipx, falls back) --------------- +## -------- install VoxVera (prefers binary, falls back) ------------- install_voxvera() { + local install_dir="$HOME/.local/bin" + mkdir -p "$install_dir" + local url latest dest="$install_dir/voxvera" + + if command_exists curl; then + msg "Attempting to download latest VoxVera binary..." + # Get the latest release tag + latest=$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/PR0M3TH3AN/VoxVera/releases/latest | grep -oE '[^/]+$') + + OS="$(uname -s | tr '[:upper:]' '[:lower:]')" + case "$OS" in + linux*) BINARY="voxvera-linux" ;; + darwin*) BINARY="voxvera-macos" ;; + *) BINARY="voxvera-linux" ;; + esac + + # Try to download architecture-specific binary first (x86_64) + ARCH=$(uname -m) + if [ "$ARCH" == "x86_64" ]; then + url="https://github.com/PR0M3TH3AN/VoxVera/releases/download/${latest}/${BINARY}-x86_64" + if curl -fsSL "$url" -o "$dest"; then + chmod +x "$dest" + msg "VoxVera binary (${ARCH}) installed to $dest" + return 0 + fi + fi + + # Fallback to generic binary + url="https://github.com/PR0M3TH3AN/VoxVera/releases/download/${latest}/${BINARY}" + if curl -fsSL "$url" -o "$dest"; then + chmod +x "$dest" + msg "VoxVera binary installed to $dest" + return 0 + fi + fi + + # Fallback to pipx if command_exists pipx; then - msg "Installing/Re-installing VoxVera via pipx..." + msg "Falling back to pipx installation (this may take a few minutes)..." if pipx install --force 'voxvera@git+https://github.com/PR0M3TH3AN/VoxVera.git@main'; then pipx ensurepath --force return 0 fi fi - # fallback: binary - local install_dir="$HOME/.local/bin" - mkdir -p "$install_dir" - local url latest dest="$install_dir/voxvera" - if command_exists curl; then - msg "Downloading VoxVera binary..." - url=$(curl -fsSLI -o /dev/null -w '%{url_effective}' \ - https://github.com/PR0M3TH3AN/VoxVera/releases/latest) - latest="${url%/}" ; latest="${latest##*/}" # vX.Y.Z tag - url="https://github.com/PR0M3TH3AN/VoxVera/releases/download/${latest/\/}/voxvera-linux" - if curl -fsSL "$url" -o "$dest"; then - chmod +x "$dest" - return 0 - fi - fi - # fallback: pip + + # Fallback to pip msg "Installing/Updating VoxVera via pip..." PIP_OPTS="--user --upgrade" if [ -f /etc/debian_version ]; then