From 24dccab3e42248ca459845c5e60627c113c6e8e8 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sat, 9 Mar 2024 01:32:17 +0900 Subject: [PATCH] fix: fix the asset name of the checksum file for windows/amd64 (#1509) Pre-built binaries and checksum files are released at GitHub Releases. https://github.com/kubeshark/kubeshark/releases But checksum files for windows/amd64 have the following issues. kubeshark.exe kubeshark_windows_amd64.sha256 - The executable file name and the checksum file name don't conform to the naming convention - We can't verify the pre-built binaries with checksum files because the pre-built binary name is different from the actual binary name ```console $ cat kubeshark_windows_amd64.sha256 ea8fffa952bc8047f493469d024887ed80f966c0d74cf5fb039ea12f71174629 kubeshark_windows_amd64 ``` ```console $ sha256sum -c kubeshark_windows_amd64.sha256 sha256sum: kubeshark_windows_amd64: No such file or directory kubeshark_windows_amd64: FAILED open or read sha256sum: WARNING: 1 listed file could not be read ``` The cause of these issues is pre-built binaries were renamed after checksum files were generated. https://github.com/kubeshark/kubeshark/blob/b125860d068f41fd7410c4ca24a88f0278b52864/Makefile#L41 https://github.com/kubeshark/kubeshark/blob/b125860d068f41fd7410c4ca24a88f0278b52864/Makefile#L61 This commit resolves the issue by generating the checksum file after renaming the pre-built binary. Co-authored-by: Volodymyr Stoiko --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 64ebc683e..097758382 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,12 @@ build-brew: ## Build binary for brew/core CI -X 'github.com/kubeshark/kubeshark/misc.Ver=$(VER)'" \ -o kubeshark kubeshark.go +build-windows-amd64: + $(MAKE) build GOOS=windows GOARCH=amd64 && \ + mv ./bin/kubeshark_windows_amd64 ./bin/kubeshark.exe && \ + rm bin/kubeshark_windows_amd64.sha256 && \ + cd bin && shasum -a 256 kubeshark.exe > kubeshark.exe.sha256 + build-all: ## Build for all supported platforms. export CGO_ENABLED=0 echo "Compiling for every OS and Platform" && \ @@ -57,8 +63,7 @@ build-all: ## Build for all supported platforms. $(MAKE) build GOOS=linux GOARCH=arm64 && \ $(MAKE) build GOOS=darwin GOARCH=amd64 && \ $(MAKE) build GOOS=darwin GOARCH=arm64 && \ - $(MAKE) build GOOS=windows GOARCH=amd64 && \ - mv ./bin/kubeshark_windows_amd64 ./bin/kubeshark.exe && \ + $(MAKE) build-windows-amd64 && \ echo "---------" && \ find ./bin -ls