diff --git a/make/buf/scripts/release.bash b/make/buf/scripts/release.bash index 0d97ae3c12..4d69635ee1 100644 --- a/make/buf/scripts/release.bash +++ b/make/buf/scripts/release.bash @@ -27,6 +27,7 @@ goarch() { x86_64) echo amd64 ;; arm64) echo arm64 ;; aarch64) echo arm64 ;; + armv7) echo arm ;; *) return 1 ;; esac } @@ -83,7 +84,7 @@ mkdir -p "${RELEASE_DIR}" cd "${RELEASE_DIR}" for os in Darwin Linux Windows; do - for arch in x86_64 arm64; do + for arch in x86_64 arm64 armv7; do # our goal is to have the binaries be suffixed with $(uname -s)-$(uname -m) # on mac, this is arm64, on linux, this is aarch64, for historical reasons # this is a hacky way to not have to rewrite this loop (and others below) @@ -100,15 +101,27 @@ for os in Darwin Linux Windows; do buf \ protoc-gen-buf-breaking \ protoc-gen-buf-lint; do - CGO_ENABLED=0 GOOS=$(goos "${os}") GOARCH=$(goarch "${arch}") \ - go build -a -ldflags "-s -w" -trimpath -buildvcs=false -o "${dir}/bin/${binary}${extension}" "${DIR}/cmd/${binary}" + if [ "${arch}" == "armv7" ]; then + if [ "${os}" == "Linux" ]; then + CGO_ENABLED=0 GOOS=$(goos "${os}") GOARCH=$(goarch "${arch}") GOARM=7 \ + go build -a -ldflags "-s -w" -trimpath -buildvcs=false -o "${dir}/bin/${binary}${extension}" "${DIR}/cmd/${binary}" + else + continue + fi + else + CGO_ENABLED=0 GOOS=$(goos "${os}") GOARCH=$(goarch "${arch}") \ + go build -a -ldflags "-s -w" -trimpath -buildvcs=false -o "${dir}/bin/${binary}${extension}" "${DIR}/cmd/${binary}" + fi cp "${dir}/bin/${binary}${extension}" "${binary}-${os}-${arch}${extension}" done done done for os in Darwin Linux Windows; do - for arch in x86_64 arm64; do + for arch in x86_64 arm64 armv7; do + if [ "${arch}" == "armv7" ] && [ "${os}" != "Linux" ]; then + continue + fi if [ "${os}" == "Linux" ] && [ "${arch}" == "arm64" ]; then arch="aarch64" fi @@ -128,7 +141,10 @@ for os in Darwin Linux Windows; do done for os in Darwin Linux; do - for arch in x86_64 arm64; do + for arch in x86_64 arm64 armv7; do + if [ "${arch}" == "armv7" ] && [ "${os}" != "Linux" ]; then + continue + fi if [ "${os}" == "Linux" ] && [ "${arch}" == "arm64" ]; then arch="aarch64" fi