diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 06635b9..91b0908 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,4 +34,4 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - asset_paths: '["./bin/kubetrim*"]' + asset_paths: '["./uploads/*"]' diff --git a/Makefile b/Makefile index 67ed6ab..28ca73a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SOURCE_DIRS = cmd pkg main.go export GO111MODULE=on .PHONY: all -all: gofmt test build dist hash +all: gofmt test build dist compress hash .PHONY: build build: @@ -21,7 +21,10 @@ test: .PHONY: dist dist: - mkdir -p bin + + mkdir -p bin/ + mkdir -p uploads/ + rm -rf bin/kubetrim* CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o bin/kubetrim CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -o bin/kubetrim-darwin CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags $(LDFLAGS) -o bin/kubetrim-darwin-arm64 @@ -30,4 +33,8 @@ dist: .PHONY: hash hash: - rm -rf bin/*.sha256 && ./hack/hashgen.sh + rm -rf uploads/*.sha256 && ./hack/hashgen.sh + +.PHONY: compress +compress: + ./hack/compress.sh \ No newline at end of file diff --git a/hack/compress.sh b/hack/compress.sh new file mode 100755 index 0000000..3d74ee5 --- /dev/null +++ b/hack/compress.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cd bin + +for f in kubetrim*; do tar -cvzf ../uploads/$f.tgz $f; done \ No newline at end of file diff --git a/hack/hashgen.sh b/hack/hashgen.sh index af80dbf..ef19074 100755 --- a/hack/hashgen.sh +++ b/hack/hashgen.sh @@ -1,3 +1,6 @@ #!/bin/sh -for f in bin/kubetrim*; do shasum -a 256 $f > $f.sha256; done +cd bin + +for f in kubetrim*; do shasum -a 256 $f > ../uploads/$f.sha256; done +