make-files / makefiles

A library of opinionated Makefiles for popular programming languages.
https://makefiles.dev
MIT License
4 stars 5 forks source link

Add archive sums to Go package #120

Closed ezzatron closed 8 months ago

ezzatron commented 8 months ago

This PR adds a new archive-sums target to the Go package. This target generates an <archive filename>.sha256 file next to each archive, as well as a sums.sha256 (containing sums for all archives), using a format suitable for verifying with sha256sum -c, e.g.:

9e1f026282e73e492e05cebf825037f53c66ed4af6ec5ed2d34dfa56dbf0498c  example-0.0.0+304895d-darwin-amd64.zip
457af0032cd451368049053f18e85ff4f34a044e4d00508294e6c0c995fd05b4  example-0.0.0+304895d-darwin-arm64.zip
8d3160a97d7ba941c09597644413c1f147b16486472137d4c7d01637fb9414c6  example-0.0.0+304895d-linux-amd64.zip
8055a802064cc9f59f4d916d92bfcae3f8aaee868986d6e27daef5a0f3ea4004  example-0.0.0+304895d-linux-arm64.zip

The sum itself is calculated using openssl, because it is more widely available than sha256sum - it's installed by default on both macOS and GitHub Actions runners. On macOS sha256sum needs to be installed via brew install coreutils or similar.

The intent here is to make it easier to publish these sums in places like GitHub releases, for later use in Homebrew taps.