From 0e7e73f0ea45bcce62b6d2282495d930ea4f2f7a Mon Sep 17 00:00:00 2001 From: Stephen Augustus Date: Sat, 17 Aug 2019 12:54:46 -0400 Subject: [PATCH] lib/releaselib: Copy release artifact SHAs to SHA{256,512}SUMS files Signed-off-by: Stephen Augustus --- lib/common.sh | 2 +- lib/releaselib.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index e6c132d7fa49..8f8128192e0f 100755 --- a/lib/common.sh +++ b/lib/common.sh @@ -647,7 +647,7 @@ common::sha () { local file=$1 local algo=${2:-256} - which shasum >/dev/null 2>&1 && LANG=C shasum -a$algo $file | awk '{print $1}' + which shasum >/dev/null 2>&1 && LANG=C shasum -a$algo $file | sed 's/ .*\// /' } ############################################################################### diff --git a/lib/releaselib.sh b/lib/releaselib.sh index fe692dcec18a..af9e4170d336 100644 --- a/lib/releaselib.sh +++ b/lib/releaselib.sh @@ -683,8 +683,16 @@ release::gcs::locally_stage_release_artifacts() { common::sha $path 256 > "$path.sha256" || return 1 common::sha $path 512 > "$path.sha512" || return 1 done -} + logecho "- Writing artifact hashes to SHA256SUMS/SHA512SUMS files..." + for sha_file in "$gcs_stage"/*.sha256; do + cat "$sha_file" >> "$gcs_stage/SHA256SUMS" + done + + for sha_file in "$gcs_stage"/*.sha512; do + cat "$sha_file" >> "$gcs_stage/SHA512SUMS" + done +} ############################################################################### # Publish a new version, (latest or stable,) but only if the