@@ -34,7 +34,8 @@ linux_platforms := linux_amd64 linux_arm64
3434non_windows_platforms := darwin_amd64 darwin_arm64 $(linux_platforms )
3535windows_platforms := windows_amd64
3636
37- archives := $(non_windows_platforms:%=dist/$(name ) _$(VERSION ) _%.tar.gz ) $(windows_platforms:%=dist/$(name ) _$(VERSION ) _%.zip )
37+ archives := $(non_windows_platforms:%=dist/$(name ) _$(VERSION ) _%.tar.gz ) $(windows_platforms:%=dist/$(name ) _$(VERSION ) _%.zip )
38+ checksums := dist/$(name ) _$(VERSION ) _checksums.txt
3839
3940# Go tools directory holds the binaries of Go-based tools.
4041go_tools_dir := $(CACHE_DIR ) /tools/go
@@ -69,8 +70,14 @@ help: ## Describe how to use each target
6970build : $(current_binary ) # # Build the proxy binary
7071
7172# This generates the assets that attach to a release.
72- # TODO(dio): Generate checksums for the assets.
73- dist : $(archives ) # # Generate release assets
73+ dist : $(archives ) $(checksums ) # # Generate release assets
74+
75+ # Darwin doesn't have sha256sum. See https://github.com/actions/virtual-environments/issues/90
76+ sha256sum := $(if $(findstring darwin,$(goos ) ) ,shasum -a 256,sha256sum)
77+ $(checksums ) : $(archives )
78+ @printf " $( ansi_format_dark) " sha256sum " generating $@ "
79+ @$(sha256sum ) $^ > $@
80+ @printf " $( ansi_format_bright) " sha256sum " ok"
7481
7582# By default, unless GOMAXPROCS is set via an environment variable or explicity in the code, the
7683# tests are run with GOMAXPROCS=1. This is problematic if the a test requires more than one CPU, for
0 commit comments