diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 0f7ae44..7ab8c37 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -14,14 +14,14 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-latest, macos-latest] + os: [ubuntu-20.04, windows-latest, macos-latest] include: - - os: ubuntu-22.04 - artifact_name: voxvera-linux + - os: ubuntu-20.04 + artifact_name: voxvera-linux-x86_64 - os: windows-latest artifact_name: voxvera-windows.exe - os: macos-latest - artifact_name: voxvera-macos + artifact_name: voxvera-macos-x86_64 steps: - name: Checkout code @@ -57,7 +57,7 @@ jobs: voxvera/cli.py - name: Build .deb (Linux) - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' run: | mkdir -p voxvera/resources/bin cp dist/${{ matrix.artifact_name }} voxvera/resources/bin/voxvera-linux-x86_64 @@ -65,7 +65,7 @@ jobs: ./packaging/build_deb.sh dist/${{ matrix.artifact_name }} - name: Build AppImage (Linux) - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' run: | mkdir -p voxvera/resources/bin cp dist/${{ matrix.artifact_name }} voxvera/resources/bin/voxvera-linux-x86_64 @@ -73,7 +73,7 @@ jobs: ./packaging/build_appimage.sh dist/${{ matrix.artifact_name }} - name: Build Flatpak (Linux) - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' run: | mkdir -p voxvera/resources/bin cp dist/${{ matrix.artifact_name }} voxvera/resources/bin/voxvera-linux-x86_64 diff --git a/install.sh b/install.sh index fdc926a..360e3c9 100755 --- a/install.sh +++ b/install.sh @@ -124,31 +124,29 @@ if command_exists curl; then mkdir -p "$install_dir" dest="$install_dir/voxvera" OS="$(uname -s | tr '[:upper:]' '[:lower:]')" + ARCH=$(uname -m) + 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 + # Try to download architecture-specific binary (e.g. voxvera-linux-x86_64) + url="https://github.com/PR0M3TH3AN/VoxVera/releases/download/${latest}/${BINARY}-${ARCH}" + # For Windows, PyInstaller might add .exe but here we focus on linux/mac + + msg "Downloading from: $url" + status=$(curl -w "%{http_code}" -fsSL "$url" -o "$dest" || echo "failed") + + if [ "$status" = "200" ]; then chmod +x "$dest" - msg "VoxVera binary installed to $dest" + msg "VoxVera binary (${ARCH}) installed to $dest" [[ ":$PATH:" != *":$HOME/.local/bin:"* ]] && warn "Add \$HOME/.local/bin to your PATH." exit 0 + else + warn "Binary download failed (status: $status). Falling back to source installation." + [ -f "$dest" ] && rm "$dest" fi fi diff --git a/voxvera-install.sh b/voxvera-install.sh index a23fc59..6821ba6 100644 --- a/voxvera-install.sh +++ b/voxvera-install.sh @@ -76,29 +76,27 @@ install_voxvera() { latest=$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/PR0M3TH3AN/VoxVera/releases/latest | grep -oE '[^/]+$') OS="$(uname -s | tr '[:upper:]' '[:lower:]')" + ARCH=$(uname -m) 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 + # Try to download architecture-specific binary (e.g. voxvera-linux-x86_64) + url="https://github.com/PR0M3TH3AN/VoxVera/releases/download/${latest}/${BINARY}-${ARCH}" + + msg "Downloading from: $url" + local status + status=$(curl -w "%{http_code}" -fsSL "$url" -o "$dest" || echo "failed") + + if [ "$status" = "200" ]; then chmod +x "$dest" - msg "VoxVera binary installed to $dest" + msg "VoxVera binary (${ARCH}) installed to $dest" return 0 + else + warn "Binary download failed (status: $status). Falling back to source installation." + [ -f "$dest" ] && rm "$dest" fi fi