From cc4b088fa956a68f7061acf99f73788f998e4260 Mon Sep 17 00:00:00 2001 From: Utsav Anand Date: Tue, 29 Dec 2020 17:05:50 +0530 Subject: [PATCH] Only upload .tgz and .sha265 files to release Signed-off-by: Utsav Anand --- .github/workflows/publish.yaml | 2 +- Makefile | 11 ++++++----- ci/compress.sh | 3 +++ ci/hashgen.sh | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100755 ci/compress.sh diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9d240647..44b51854 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -19,4 +19,4 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - asset_paths: '["./bin/*"]' + asset_paths: '["./uploads/*"]' diff --git a/Makefile b/Makefile index 8511d9e5..be0e327b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GitCommit := $(shell git rev-parse HEAD) LDFLAGS := "-s -w -X main.Version=$(Version) -X main.GitCommit=$(GitCommit)" export GO111MODULE=on .PHONY: all -all: gofmt test dist hashgen +all: gofmt test dist compress hashgen .PHONY: test test: @@ -16,10 +16,15 @@ gofmt: .PHONY: hashgen hashgen: ./ci/hashgen.sh + +.PHONY: compress +compress: + ./ci/compress.sh .PHONY: dist dist: mkdir -p bin/ + mkdir -p uploads/ rm -rf bin/inlets* CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-darwin @@ -27,7 +32,3 @@ dist: CGO_ENABLED=0 GOOS=freebsd go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-freebsd CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-armhf CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl-arm64 - - echo "Compressing the compiled artifacts" - find bin -name "inletsctl*" -exec tar -cvzf {}.tgz {} \; - diff --git a/ci/compress.sh b/ci/compress.sh new file mode 100755 index 00000000..eb8a59d5 --- /dev/null +++ b/ci/compress.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd bin +for f in inletsctl*; do tar -cvzf ../uploads/$f.tgz $f; done \ No newline at end of file diff --git a/ci/hashgen.sh b/ci/hashgen.sh index 07ed6de4..7a1ec5f8 100755 --- a/ci/hashgen.sh +++ b/ci/hashgen.sh @@ -1,3 +1,3 @@ #!/bin/sh cd bin -for f in inletsctl*; do shasum -a 256 $f > $f.sha256; done +for f in inletsctl*; do shasum -a 256 $f > ../uploads/$f.sha256; done