Skip to content

Commit

Permalink
Only upload .tgz and .sha265 files to release
Browse files Browse the repository at this point in the history
Signed-off-by: Utsav Anand <[email protected]>
  • Loading branch information
utsavanand2 committed Dec 29, 2020
1 parent 45b3698 commit cc4b088
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./bin/*"]'
asset_paths: '["./uploads/*"]'
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -16,18 +16,19 @@ 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
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/inletsctl.exe
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 {} \;

3 changes: 3 additions & 0 deletions ci/compress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd bin
for f in inletsctl*; do tar -cvzf ../uploads/$f.tgz $f; done
2 changes: 1 addition & 1 deletion ci/hashgen.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cc4b088

Please sign in to comment.