From 14d521f2a1c661bab98752e0f70ff424ccb92e9e Mon Sep 17 00:00:00 2001 From: Tom Czarniecki Date: Mon, 25 Apr 2022 07:01:55 +1000 Subject: [PATCH] only release gzipped files --- .github/workflows/release.yml | 2 +- Makefile | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 895728a5..a89053b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,4 +25,4 @@ jobs: prerelease: false files: | LICENSE.md - target/s3backup* + target/*.gz diff --git a/Makefile b/Makefile index 1539c4af..7ebc09f0 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ GIT_TAG := $(shell git describe --tags 2>/dev/null) LDFLAGS := -s -w -X github.com/tomcz/s3backup/config.commit=${GITCOMMIT} LDFLAGS := ${LDFLAGS} -X github.com/tomcz/s3backup/config.tag=${GIT_TAG} +OUTFILE ?= s3backup .PHONY: precommit precommit: clean generate format lint test compile @@ -47,21 +48,14 @@ endif .PHONY: compile compile: target - go build -ldflags "${LDFLAGS}" -o target ./cmd/... - -pack = gzip -c < target/s3backup > target/s3backup-${1}.gz + go build -ldflags "${LDFLAGS}" -o target/${OUTFILE} ./cmd/s3backup/... + gzip -c < target/${OUTFILE} > target/${OUTFILE}.gz .PHONY: cross-compile cross-compile: - GOOS=linux GOARCH=amd64 $(MAKE) compile - #$(call pack,linux-amd64) - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(MAKE) compile - #$(call pack,linux-amd64-nocgo) - GOOS=darwin GOARCH=amd64 $(MAKE) compile - #$(call pack,osx-amd64) - GOOS=darwin GOARCH=arm64 $(MAKE) compile - #$(call pack,osx-arm64) - GOOS=windows GOARCH=amd64 $(MAKE) compile - #$(call pack,win-amd64.exe) - GOOS=windows GOARCH=386 $(MAKE) compile - #$(call pack,win-386.exe) + OUTFILE=s3backup-linux-amd64 GOOS=linux GOARCH=amd64 $(MAKE) compile + OUTFILE=s3backup-linux-nocgo CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(MAKE) compile + OUTFILE=s3backup-osx-amd64 GOOS=darwin GOARCH=amd64 $(MAKE) compile + OUTFILE=s3backup-osx-arm64 GOOS=darwin GOARCH=arm64 $(MAKE) compile + OUTFILE=s3backup-win-amd64.exe GOOS=windows GOARCH=amd64 $(MAKE) compile + OUTFILE=s3backup-win-386.exe GOOS=windows GOARCH=386 $(MAKE) compile