From 977fe4b4eab683c7b96ee7515e6e096d4e96393f Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 6 Jul 2026 16:16:44 +0200 Subject: [PATCH] fix(ci): install mtg-multi without GOBIN for cross-compiled release builds go install refuses to run with GOBIN set when GOOS/GOARCH differ from the host, which failed the linux release build for every non-amd64 platform (386, arm64, armv7, armv6). Let it install into GOPATH/bin instead, where cross-compiled binaries land in a GOOS_GOARCH subdirectory, and locate the binary there. DockerInit.sh keeps GOBIN because buildx runs it under emulation for the target platform, making the install native. --- .github/workflows/release.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac74684cf..9fdd66186 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -159,11 +159,16 @@ jobs: # mtg-multi (MTProto sidecar) is pure Go, so build it from source for the # target arch (GOOS/GOARCH/GOARM are already exported above). Its release # binaries only cover linux/darwin amd64/arm64; skip s390x/armv5 as before. + # go install rejects GOBIN for cross-compiled targets, so let it install + # into GOPATH/bin (a GOOS_GOARCH subdir when cross-compiling) and fetch + # the binary from there. MTG_MULTI_VER="v1.11.0" case "${{ matrix.platform }}" in amd64|arm64|armv7|armv6|386) - CGO_ENABLED=0 GOBIN="$(pwd)" go install -trimpath -ldflags "-s -w" "github.com/dolonet/mtg-multi@${MTG_MULTI_VER}" - mv mtg-multi "mtg-linux-${{ matrix.platform }}" + CGO_ENABLED=0 go install -trimpath -ldflags "-s -w" "github.com/dolonet/mtg-multi@${MTG_MULTI_VER}" + MTG_BIN=$(find "$(go env GOPATH)/bin" -type f -name mtg-multi | head -n1) + [ -n "$MTG_BIN" ] || { echo "mtg-multi binary not found under $(go env GOPATH)/bin" >&2; exit 1; } + mv "$MTG_BIN" "mtg-linux-${{ matrix.platform }}" ;; esac cd ../..