diff --git a/.goreleaser.yml b/.goreleaser.yml index 2fe25bdd..ff55ee6e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,6 +7,7 @@ builds: - darwin goarch: - amd64 + - arm64 main: ./cmd/build-load/main.go flags: - -tags diff --git a/Makefile b/Makefile index 348af5aa..98e751fb 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ version := $(shell git describe --tags 2>/dev/null || (git rev-parse HEAD | cut -c-8)) sources := $(wildcard cmd/*/*.go internal/*/*.go) goos := $(shell uname | tr '[:upper:]' '[:lower:]') -goarch := $(shell uname -m | sed 's/x86_64/amd64/') +goarch := $(shell uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') .PHONY: all all: clean verify build @@ -50,3 +50,11 @@ install: $(sources) -ldflags='-s -w -extldflags "-static" -X github.com/homeport/build-load/internal/cmd.version=$(version)' \ -o /usr/local/bin/build-load \ cmd/build-load/main.go + +.PHONY: install-user +install-user: $(sources) + @GO111MODULE=on CGO_ENABLED=0 GOOS=$(goos) GOARCH=$(goarch) go build \ + -tags netgo \ + -ldflags='-s -w -extldflags "-static" -X github.com/homeport/build-load/internal/cmd.version=$(version)' \ + -o "${HOME}/bin/build-load" \ + cmd/build-load/main.go diff --git a/hack/download.sh b/hack/download.sh index 3345c429..66ad4fc4 100755 --- a/hack/download.sh +++ b/hack/download.sh @@ -56,7 +56,7 @@ else fi SYSTEM_UNAME="$(uname | tr '[:upper:]' '[:lower:]')" -SYSTEM_ARCH="$(uname -m | sed 's/x86_64/amd64/')" +SYSTEM_ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')" # Download and install DOWNLOAD_URI="$(curl --silent --location "https://api.github.com/repos/${ORG}/${REPO}/releases/tags/${SELECTED_TAG}" | jq --raw-output ".assets[] | select( (.name | contains(\"${SYSTEM_UNAME}\")) and (.name | contains(\"${SYSTEM_ARCH}\")) ) | .browser_download_url")"