alexellis / kubetrim

Trim 📏 your KUBECONFIG automatically
MIT License
93 stars 6 forks source link

add compression to binaries #5

Closed rgee0 closed 1 month ago

rgee0 commented 1 month ago

Adds binary compression via changes to makefile and the addition of a new hack script to preform the compression

Tested in local repo Actions:

go build
mkdir -p bin/
mkdir -p uploads/
rm -rf bin/kubetrim*
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X github.com/alexellis/kubetrim/pkg.Version= -X github.com/alexellis/kubetrim/pkg.GitCommit=0e65a100cd1c19f6[53](https://github.com/rgee0/kubetrim/actions/runs/10722512660/job/29733604009#step:4:54)dd120d3ee904acc2492cf0" -o bin/kubetrim
CGO_ENABLED=0 GOOS=darwin go build -ldflags "-s -w -X github.com/alexellis/kubetrim/pkg.Version= -X github.com/alexellis/kubetrim/pkg.GitCommit=0e65a100cd1c19f653dd120d3ee904acc2492cf0" -o bin/kubetrim-darwin
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags "-s -w -X github.com/alexellis/kubetrim/pkg.Version= -X github.com/alexellis/kubetrim/pkg.GitCommit=0e65a100cd1c19f653dd120d3ee904acc2492cf0" -o bin/kubetrim-darwin-arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X github.com/alexellis/kubetrim/pkg.Version= -X github.com/alexellis/kubetrim/pkg.GitCommit=0e65a100cd1c19f653dd120d3ee904acc2492cf0" -o bin/kubetrim-arm64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X github.com/alexellis/kubetrim/pkg.Version= -X github.com/alexellis/kubetrim/pkg.GitCommit=0e65a100cd1c19f653dd120d3ee904acc2492cf0" -o bin/kubetrim.exe
./hack/compress.sh
kubetrim
kubetrim-arm64
kubetrim-darwin
kubetrim-darwin-arm64
kubetrim.exe
rm -rf uploads/*.sha256 && ./hack/hashgen.sh

Action exited green - https://github.com/rgee0/kubetrim/actions/runs/10722512660/job/29733604009

Released binaries: https://github.com/rgee0/kubetrim/releases

Closes #3

alexellis commented 1 month ago

Could you do a release on your repo to check the files are uploaded as expected?

rgee0 commented 1 month ago

https://github.com/rgee0/kubetrim/releases