diff --git a/README.md b/README.md index 8a9218f..d673c1f 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,15 @@ separate script.  +## Building + +Python3, Go, and git all must be installed to run the build script. + +Once the dependencies are installed, clone this repo and run +`python build_release.py`. If you only want to build for certain OS or +ARCH targets, edit the `targets` array in the `build_release.py` file +before running it. + ## Links @Owl-Tec's write up using this tool with ACDS: diff --git a/build_release.py b/build_release.py index 49b8d95..cd2fe97 100644 --- a/build_release.py +++ b/build_release.py @@ -8,6 +8,20 @@ import tarfile # output path (relative to this script) outRelativeDir = "_out" +# target strings must be in the format: +# `GOOS_GOARCH` +# see: https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go +# or unofficially: https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63 +targets = [ + "windows_amd64", + "linux_amd64", + "linux_arm64", + "darwin_amd64", + "darwin_arm64", + "freebsd_amd64", + "freebsd_arm64", +] + ### # Script @@ -25,17 +39,6 @@ os.makedirs(releaseDir) # get version number / tag gitTag = subprocess.check_output("git describe --tags --abbrev=0").decode('utf-8').strip() -# # GOOS_GOARCH to build for -targets = [ - "windows_amd64", - "linux_amd64", - "linux_arm64", - "darwin_amd64", - "darwin_arm64", - "freebsd_amd64", - "freebsd_arm64", -] - # loop through and build all targets for target in targets: # environment vars