From f60e123d323a5940503a4f56ae4de887eadcd6e8 Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Mon, 25 Dec 2023 15:19:56 +0800 Subject: [PATCH] feat(packages/scripts): add checksum(sha256) for files in OCI (#185) Fixes #182 Signed-off-by: wuhuizuo Signed-off-by: wuhuizuo --- packages/scripts/build-package-artifacts.sh.tmpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/scripts/build-package-artifacts.sh.tmpl b/packages/scripts/build-package-artifacts.sh.tmpl index 11bdcb29..49daa1ac 100644 --- a/packages/scripts/build-package-artifacts.sh.tmpl +++ b/packages/scripts/build-package-artifacts.sh.tmpl @@ -149,6 +149,7 @@ function archive() { popd rm -rf $archive_dir echo "$save_file" + sha256sum -b "$save_file" | cut -d ' ' -f1 > "$save_file.sha256" # <<<<<<<<<<<<<<<< file: {{ .name }} <<<<<<<<<<<<<<<< {{- end }} } @@ -168,6 +169,7 @@ function push_files() { pushd "$release_ws" oras push --artifact-type application/gzip ${destination} {{- range (.artifacts | jq `map(select(.type == "file" or .type == null))`) }}{{ printf " %s" .name }}{{- end }} + {{- range (.artifacts | jq `map(select(.type == "file" or .type == null))`) }}{{ printf " %s.sha256" .name }}{{- end }} popd {{- $tag_suffix := printf "-%s_%s_%s" .profile .os .arch -}} @@ -197,6 +199,7 @@ oci: files: {{- range (.artifacts | jq `map(select(.type == "file" or .type == null))`) }} {{ printf "- %s" .name }} + {{ printf "- %s.sha256" .name }} {{- end }} EOF }