Skip to content

Commit 568cea2

Browse files
authored
build: Add rule to generate SHA256 checksums for each binary
This commit adds a new rule to the Makefile named `checksums`, which generates SHA256 checksums for each binary after building them. The `checksums` rule iterates over each binary file (for Windows, Linux, and macOS), calculates its SHA256 checksum using `sha256sum`, and saves the checksum to a separate `.sha256` file in the `bin` directory. This enhancement provides users with an easy way to verify the integrity of the generated binaries.
1 parent 6a9debe commit 568cea2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ linux:
2424
darwin:
2525
GOOS=darwin GOARCH=amd64 go build -o $(OUT_DIR)/$(DARWIN_BIN)
2626

27+
# Generate SHA256 checksums for each binary
28+
checksums:
29+
@echo "Generating SHA256 checksums..."
30+
@for binary in $(WINDOWS_BIN) $(LINUX_BIN) $(DARWIN_BIN); do \
31+
sha256sum $(OUT_DIR)/$$binary > $(OUT_DIR)/$$binary.sha256; \
32+
done
33+
@echo "Checksum files generated successfully."
34+
2735
# Clean the built binaries
2836
clean:
2937
rm -rf $(OUT_DIR)

0 commit comments

Comments
 (0)