From c4fa517d29fe9faf0a05d378a52703247c09dcae Mon Sep 17 00:00:00 2001 From: Steven Gettys Date: Wed, 22 Feb 2023 13:50:59 -0800 Subject: [PATCH] Added multi arch support to xbuildall Signed-off-by: Steven Gettys --- releases/build.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/releases/build.go b/releases/build.go index 0803f5e..c8aaf07 100644 --- a/releases/build.go +++ b/releases/build.go @@ -12,9 +12,10 @@ import ( ) var ( - runtimeArch = "amd64" - runtimePlatform = "linux" - supportedClientGOOS = []string{"linux", "darwin", "windows"} + runtimeArch = "amd64" + runtimePlatform = "linux" + supportedClientGOOS = []string{"linux", "darwin", "windows"} + supportedClientGOARCH = []string{"amd64", "arm64"} ) func getLDFLAGS(pkg string) string { @@ -73,9 +74,12 @@ func XBuildAll(pkg string, name string, binDir string) { var g errgroup.Group for _, goos := range supportedClientGOOS { goos := goos - g.Go(func() error { - return XBuild(pkg, name, binDir, goos, "amd64") - }) + for _, goarch := range supportedClientGOARCH { + goarch := goarch + g.Go(func() error { + return XBuild(pkg, name, binDir, goos, goarch) + }) + } } mgx.Must(g.Wait())