Skip to content

Commit

Permalink
Support arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaSchwarze0 authored and HeavyWombat committed Apr 1, 2021
1 parent acbf988 commit a816c08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ builds:
- darwin
goarch:
- amd64
- arm64
main: ./cmd/build-load/main.go
flags:
- -tags
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion hack/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
Expand Down

0 comments on commit a816c08

Please sign in to comment.