From c921213b4f370ab67adf722e223b4bd77fb8f4cb Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 19 Aug 2021 11:09:04 +0200 Subject: [PATCH] Reduce number of build targets --- tasks.py | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/tasks.py b/tasks.py index 0109782..9c61417 100644 --- a/tasks.py +++ b/tasks.py @@ -4,38 +4,15 @@ from pathlib import Path from invoke import Context, task TARGETS = [ - "aix/ppc64", "darwin/amd64", - "dragonfly/amd64", "freebsd/386", "freebsd/amd64", "freebsd/arm", "freebsd/arm64", - "illumos/amd64", "linux/386", "linux/amd64", "linux/arm", "linux/arm64", - "linux/ppc64", - "linux/ppc64le", - "linux/mips", - "linux/mipsle", - "linux/mips64", - "linux/mips64le", - "linux/riscv64", - "linux/s390x", - "netbsd/386", - "netbsd/amd64", - "netbsd/arm", - "netbsd/arm64", - "openbsd/386", - "openbsd/amd64", - "openbsd/arm", - "openbsd/arm64", - "plan9/386", - "plan9/amd64", - "plan9/arm", - "solaris/amd64", "windows/386", "windows/amd64", "windows/arm", @@ -51,13 +28,20 @@ def tag(context, tag): @task -def build(context): +def build(context, version_name): """Cross-platform build""" with ThreadPoolExecutor() as pool: for target in TARGETS: os, arch = target.split("/") - binary_name = f"insee-{os}-{arch}" + binary_name = f"insee-{version_name}-{os}-{arch}" if os == "windows": binary_name += ".exe" - binary_path = Path(__file__).resolve(strict=True).parent / "dist" / binary_name - pool.submit(context.run, f"go build -o {binary_path}", env={"GOOS": os, "GOARCH": arch}, echo=True) + binary_path = ( + Path(__file__).resolve(strict=True).parent / "dist" / binary_name + ) + pool.submit( + context.run, + f"go build -o {binary_path}", + env={"GOOS": os, "GOARCH": arch}, + echo=True, + )