diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a3bade7..f845012 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -5,6 +5,12 @@ version: 2 project_name: mcp-filepuff +# Split mode by full target (goos+goarch). Each matrix runner only builds the +# artifact matching its own architecture, avoiding CGO cross-compile failures +# (ARM asm on x86 runners and vice versa). +partial: + by: target + before: hooks: - go mod tidy @@ -36,20 +42,15 @@ builds: archives: - id: default + # Ship raw binaries — downloaders curl the asset and run it directly + # (Windows gets .exe appended automatically). No tarball indirection. formats: - - tar.gz + - binary name_template: >- {{ .ProjectName }}_ {{- .Version }}_ {{- .Os }}_ {{- .Arch }} - files: - - LICENSE - - README.md - format_overrides: - - goos: windows - formats: - - zip checksum: name_template: 'checksums.txt' diff --git a/README.md b/README.md index 32afdca..99ee7b0 100644 --- a/README.md +++ b/README.md @@ -59,24 +59,24 @@ Download pre-built binaries from the [releases page](https://github.com/lukaszra ```bash # macOS (ARM64) -curl -L https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__darwin_arm64.tar.gz | tar xz -mv mcp-filepuff ~/.local/bin/ +curl -fsSL -o mcp-filepuff https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__darwin_arm64 +chmod +x mcp-filepuff && mv mcp-filepuff ~/.local/bin/ # macOS (AMD64) -curl -L https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__darwin_amd64.tar.gz | tar xz -mv mcp-filepuff ~/.local/bin/ +curl -fsSL -o mcp-filepuff https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__darwin_amd64 +chmod +x mcp-filepuff && mv mcp-filepuff ~/.local/bin/ # Linux (ARM64) -curl -L https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__linux_arm64.tar.gz | tar xz -mv mcp-filepuff ~/.local/bin/ +curl -fsSL -o mcp-filepuff https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__linux_arm64 +chmod +x mcp-filepuff && mv mcp-filepuff ~/.local/bin/ # Linux (AMD64) -curl -L https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__linux_amd64.tar.gz | tar xz -mv mcp-filepuff ~/.local/bin/ +curl -fsSL -o mcp-filepuff https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__linux_amd64 +chmod +x mcp-filepuff && mv mcp-filepuff ~/.local/bin/ # Windows (PowerShell) -Invoke-WebRequest -Uri "https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__windows_amd64.zip" -OutFile mcp-filepuff.zip -Expand-Archive mcp-filepuff.zip -DestinationPath $env:USERPROFILE\.local\bin +Invoke-WebRequest -Uri "https://github.com/lukaszraczylo/filepuff-mcp/releases/latest/download/mcp-filepuff__windows_amd64.exe" -OutFile mcp-filepuff.exe +Move-Item mcp-filepuff.exe $env:USERPROFILE\.local\bin\ ``` Replace `` with the actual version (e.g., `v1.0.0`). diff --git a/scripts/install.sh b/scripts/install.sh index 7b61423..0aae2c6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -59,13 +59,6 @@ detect_platform() { ;; esac - # Warn about unsupported combinations - if [ "$os" = "linux" ] && [ "$arch" = "arm64" ]; then - print_error "Linux ARM64 builds are not currently available due to CGO cross-compilation complexity" - print_error "Please build from source: https://github.com/lukaszraczylo/filepuff-mcp#build-from-source" - exit 1 - fi - echo "${os}_${arch}" } @@ -73,7 +66,7 @@ check_dependencies() { local missing_deps=() # Check for required commands - for cmd in curl tar; do + for cmd in curl; do if ! command -v "$cmd" &> /dev/null; then missing_deps+=("$cmd") fi @@ -210,14 +203,15 @@ download_and_install() { print_info "Downloading mcp-filepuff ${version} for ${platform}..." - # Construct download URLs - local archive_name="mcp-filepuff_${version#v}_${platform}.tar.gz" - local archive_url="https://github.com/${REPO}/releases/download/${version}/${archive_name}" + # Releases ship raw binaries named mcp-filepuff___ + # (with .exe on Windows — not handled here). + local asset_name="mcp-filepuff_${version#v}_${platform}" + local asset_url="https://github.com/${REPO}/releases/download/${version}/${asset_name}" local checksum_url="https://github.com/${REPO}/releases/download/${version}/checksums.txt" - # Download archive - if ! curl -sSfL "$archive_url" -o "$tmpdir/$archive_name"; then - print_error "Failed to download $archive_url" + # Download binary + if ! curl -sSfL "$asset_url" -o "$tmpdir/$asset_name"; then + print_error "Failed to download $asset_url" exit 1 fi @@ -227,26 +221,24 @@ download_and_install() { else print_info "Verifying checksum..." cd "$tmpdir" - - # Extract expected checksum for our archive + local expected_checksum - expected_checksum=$(grep "$archive_name" checksums.txt | awk '{print $1}') - + expected_checksum=$(grep "$asset_name" checksums.txt | awk '{print $1}') + if [ -z "$expected_checksum" ]; then - print_warn "Checksum not found for $archive_name, skipping verification" + print_warn "Checksum not found for $asset_name, skipping verification" else - # Calculate actual checksum (use shasum on macOS, sha256sum on Linux) local actual_checksum if command -v sha256sum &> /dev/null; then - actual_checksum=$(sha256sum "$archive_name" | awk '{print $1}') + actual_checksum=$(sha256sum "$asset_name" | awk '{print $1}') elif command -v shasum &> /dev/null; then - actual_checksum=$(shasum -a 256 "$archive_name" | awk '{print $1}') + actual_checksum=$(shasum -a 256 "$asset_name" | awk '{print $1}') else print_warn "No checksum utility found, skipping verification" cd - > /dev/null return fi - + if [ "$expected_checksum" = "$actual_checksum" ]; then print_info "Checksum verification passed" else @@ -259,10 +251,6 @@ download_and_install() { cd - > /dev/null fi - # Extract archive - print_info "Extracting archive..." - tar -xzf "$tmpdir/$archive_name" -C "$tmpdir" - # Ensure install directory exists if [ ! -d "$INSTALL_DIR" ]; then print_info "Creating installation directory: $INSTALL_DIR" @@ -272,11 +260,11 @@ download_and_install() { # Install binary print_info "Installing to $INSTALL_DIR/$BINARY_NAME..." if [ -w "$INSTALL_DIR" ]; then - cp "$tmpdir/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME" + cp "$tmpdir/$asset_name" "$INSTALL_DIR/$BINARY_NAME" chmod +x "$INSTALL_DIR/$BINARY_NAME" else print_warn "No write permission to $INSTALL_DIR, trying with sudo..." - sudo cp "$tmpdir/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME" + sudo cp "$tmpdir/$asset_name" "$INSTALL_DIR/$BINARY_NAME" sudo chmod +x "$INSTALL_DIR/$BINARY_NAME" fi