Fix/release split by target (#14)

* fix(release): split partial by target to avoid CGO cross-compile

goreleaser --split defaults to splitting by GOOS only, so on a
linux_amd64 runner it tried to build both linux/amd64 and linux/arm64
CGO binaries. The amd64 host gcc cannot assemble ARM64 runtime/cgo
(gcc_arm64.S: no such instruction: stp, ldp, blr).

Setting partial.by: target makes goreleaser split by the full
goos+goarch tuple. Each matrix runner then builds only the artifact
matching its own architecture — native CGO compile, no cross-toolchain
needed.

* feat(release): ship raw binaries instead of tar.gz/zip archives

Users want curl-and-run, not 'download archive, unpack, locate binary'.
Switched archives.formats from tar.gz (with zip override for Windows)
to binary. goreleaser now emits:

  mcp-filepuff_<v>_darwin_amd64
  mcp-filepuff_<v>_darwin_arm64
  mcp-filepuff_<v>_linux_amd64
  mcp-filepuff_<v>_linux_arm64
  mcp-filepuff_<v>_windows_amd64.exe

Dropped the LICENSE+README bundling — tree-view on the release page
still shows them, and no one was extracting them from tarballs to
read anyway.

* docs,install: drop tarball indirection; download raw binary

Releases now ship raw binaries (goreleaser archives.formats=binary).
install.sh and README manual-install blurb now curl the binary
directly, chmod +x, and move into place. No tar, no zip, no extract.

Also removes the Linux ARM64 hard-reject in install.sh — that platform
is now shipped from the ubuntu-24.04-arm matrix runner.
This commit is contained in:
2026-04-19 23:01:44 +01:00
committed by GitHub
parent f1643e7b81
commit 1ef24994ca
3 changed files with 36 additions and 47 deletions
+9 -8
View File
@@ -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'
+10 -10
View File
@@ -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_<version>_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_<version>_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_<version>_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_<version>_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_<version>_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_<version>_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_<version>_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_<version>_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_<version>_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_<version>_windows_amd64.exe" -OutFile mcp-filepuff.exe
Move-Item mcp-filepuff.exe $env:USERPROFILE\.local\bin\
```
Replace `<version>` with the actual version (e.g., `v1.0.0`).
+17 -29
View File
@@ -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_<version>_<os>_<arch>
# (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