diff --git a/Makefile b/Makefile index 029d127e..0e4d1286 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,14 @@ GOBUILD=CGO_ENABLED=0 go build -ldflags '-w -s -buildid=' # The -w and -s flags reduce binary sizes by excluding unnecessary symbols and debug info # The -buildid= flag makes builds reproducible -all: linux macos-amd64 macos-arm64 win64 win32 +all: linux-amd64 linux-arm64 macos-amd64 macos-arm64 win64 win32 -linux: +linux-amd64: GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ +linux-arm64: + GOARCH=arm64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ + macos-amd64: GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@ @@ -22,11 +25,14 @@ win32: GOARCH=386 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)-$@.exe -test: test-linux test-macos-amd64 test-macos-arm64 test-win64 test-win32 +test: test-linux-amd64 test-linux-arm64 test-macos-amd64 test-macos-arm64 test-win64 test-win32 -test-linux: +test-linux-amd64: GOARCH=amd64 GOOS=linux go test +test-linux-arm64: + GOARCH=arm64 GOOS=linux go test + test-macos-amd64: GOARCH=amd64 GOOS=darwin go test @@ -39,10 +45,12 @@ test-win64: test-win32: GOARCH=386 GOOS=windows go test -releases: linux macos-amd64 macos-arm64 win64 win32 +releases: linux-amd64 linux-arm64 macos-amd64 macos-arm64 win64 win32 chmod +x $(BINDIR)/$(NAME)-* - tar czf $(BINDIR)/$(NAME)-linux.tgz -C $(BINDIR) $(NAME)-linux - gzip $(BINDIR)/$(NAME)-linux + tar czf $(BINDIR)/$(NAME)-linux-amd64.tgz -C $(BINDIR) $(NAME)-linux-amd64 + tar czf $(BINDIR)/$(NAME)-linux-arm64.tgz -C $(BINDIR) $(NAME)-linux-arm64 + gzip $(BINDIR)/$(NAME)-linux-amd64 + gzip $(BINDIR)/$(NAME)-linux-arm64 gzip $(BINDIR)/$(NAME)-macos-amd64 gzip $(BINDIR)/$(NAME)-macos-arm64 zip -m -j $(BINDIR)/$(NAME)-win32.zip $(BINDIR)/$(NAME)-win32.exe @@ -55,8 +63,10 @@ clean: GITHUB_UPLOAD_URL=$(shell echo $${GITHUB_RELEASE_UPLOAD_URL%\{*}) upload: releases - curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-linux.tgz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-linux.tgz" - curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-linux.gz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-linux.gz" + curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-linux-amd64.tgz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-linux-amd64.tgz" + curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-linux-arm64.tgz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-linux-arm64.tgz" + curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-linux-amd64.gz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-linux-amd64.gz" + curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-linux-arm64.gz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-linux-arm64.gz" curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-macos-amd64.gz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-macos-amd64.gz" curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/gzip" --data-binary @$(BINDIR)/$(NAME)-macos-arm64.gz "$(GITHUB_UPLOAD_URL)?name=$(NAME)-macos-arm64.gz" curl -H "Authorization: token $(GITHUB_TOKEN)" -H "Content-Type: application/zip" --data-binary @$(BINDIR)/$(NAME)-win64.zip "$(GITHUB_UPLOAD_URL)?name=$(NAME)-win64.zip"